Skip to content

Commit 302bad4

Browse files
committed
docs: new logo, update README and fix font/image
1 parent 644fd23 commit 302bad4

24 files changed

+355
-114
lines changed

.config/tsconfig.eslint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"../.wallaby.js",
1212
"../eslint.config.js",
1313
"../.commitlintrc.js",
14-
"./typedoc.js"
14+
"./typedoc.js",
15+
"../assets/font-loader.js"
1516
]
1617
}

.config/typedoc.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1+
import { readFileSync } from 'node:fs';
12
import { OptionDefaults } from 'typedoc';
23

3-
/** @type {Partial<import('typedoc').TypeDocOptions>} */
4+
/**
5+
* @import {TypeDocOptions} from 'typedoc'
6+
*/
7+
8+
const customFooterHtml = readFileSync(
9+
new URL('../assets/footer.html', import.meta.url),
10+
'utf8',
11+
);
12+
13+
/** @type {Partial<TypeDocOptions>} */
414
export default {
515
blockTags: [...OptionDefaults.blockTags, '@knipignore', '@assertion'],
616
cleanOutputDir: true,
717
cname: 'bupkis.zip',
8-
customCss: './bupkis-theme.css',
18+
customCss: '../assets/bupkis-theme.css',
19+
customFooterHtml,
20+
customJs: '../assets/font-loader.js',
921
darkHighlightTheme: 'red',
1022
entryPoints: ['../src/index.ts'],
1123
excludeInternal: true,
@@ -27,6 +39,7 @@ export default {
2739
ZodType: 'https://zod.dev/packages/core#schemas',
2840
},
2941
},
42+
favicon: '../assets/favicon.svg',
3043
hostedBaseUrl: 'https://boneskull.github.io/bupkis',
3144
kindSortOrder: [
3245
'Reference',
@@ -52,7 +65,13 @@ export default {
5265
'typedoc-plugin-mdn-links',
5366
'typedoc-plugin-zod',
5467
],
55-
projectDocuments: ['../site/*.md', '../ROADMAP.md', '../CHANGELOG.md'],
68+
projectDocuments: [
69+
'../site/*.md',
70+
'../ROADMAP.md',
71+
'../CHANGELOG.md',
72+
'../assets/Twentieth-Century-Bold.woff2',
73+
],
74+
searchInDocuments: true,
5675
sort: ['kind'],
5776
tsconfig: './tsconfig.typedoc.json',
5877
};

README.md

Lines changed: 100 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
<p align="center">
2-
<img src="https://bupkis.zip/assets/bupkis-logo-256.png" width="256px" align="center" alt="BUPKIS logo"/>
3-
<h1 align="center"><em><span class="federo-caps">BUPKIS<span></em></h1>
2+
<img src="./assets/bupkis-logo-512.png" width="512px" align="center" alt="BUPKIS logo"/>
3+
<h1 align="center"><span class="twentieth-century-caps">BUPKIS<span></h1>
44
<p align="center">
5-
A well-typed and easily exensible <em>BDD-style</em> assertion library.
5+
A well-typed and easily exensible <em>BDD-style</em> assertion library
66
<br/>
7-
by <a href="https://github.com/boneskull">@boneskull</a>
7+
<small>by <a href="https://github.com/boneskull">@boneskull</a></small>
88
</p>
99
</p>
1010

11+
## Quick Links
12+
13+
- [BUPKIS' Homepage][docs] (<https://bupkis.zip>)
14+
- [Assertion Reference][assertion-reference]
15+
- [Guide: Basic Usage][basic-usage]
16+
- [Guide: How to Create a Custom Assertion][create-a-custom-assertion]
17+
1118
## Motivation
1219

20+
> "_Another_ assertion library? Are you daft? My test framework has its own assertions!"
21+
>
22+
> ‒sickos, probably
23+
1324
Look, I'm ~~old~~ ~~wizened~~ ~~experienced~~ knowledegable and I've written a lot of tests. I've used a lot of assertion libraries. There are ones I prefer and ones I don't.
1425

1526
But none of them do quite what _this_ does. The main goals of this library are:
@@ -20,15 +31,15 @@ But none of them do quite what _this_ does. The main goals of this library are:
2031

2132
A chainable API may provide type safety. But it seems to _guarantee_ implementing a custom assertion will be complicated. The API surface is necessarily a combinatoric explosion of methods.
2233

23-
> [!WARNING]
34+
> ⚠️ **Caution!**
2435
>
25-
> Because chainable APIs are familiar, you may hate _BUPKIS_ once you see some examples. You don't have to use it, but please: _don't confuse familiarity with usability_.
36+
> Because chainable APIs are familiar, you may hate _BUPKIS_ once you see some examples. Nobody's making you use it. But please, keep an open mind & give me this grace: _don't confuse familiarity with usability_.
2637
27-
To achieve these goals, I've adopted the following design principles:
38+
To achieve these goals, _BUPKIS_ makes the following design choices.
2839

29-
### Natural-Language Assertions
40+
### Assertions are Natural Language
3041

31-
In `bupkis` (stylized as "_BUPKIS_"), you **don't** write this:
42+
When you're using _BUPKIS_, you **don't** write this:
3243

3344
```js
3445
expect(actual).toEqual(expected);
@@ -60,98 +71,115 @@ Then _BUPKIS_ wants you to write:
6071

6172
```js
6273
expect(actual, 'to be a string');
63-
// it is tolerant of poor/ironic grammar
74+
// it is tolerant of poor/ironic grammar, sometimes
6475
expect(actual, 'to be an string');
6576
```
6677

67-
Can't remember the string? Did you forget a word or make a typo? Maybe you also forgot _BUPKIS_ is type-safe? You'll get a nice squiggly for your trouble.
78+
Can't remember the string? Did you forget a word or make a typo? Maybe you also forgot **_BUPKIS_ is type-safe?** You'll get a nice squiggly for your trouble. This isn't black magic. It ain't a _cauldron_. We're not just _throwing rat tails and `string`s in there._
79+
80+
> "Preposterous! Codswallop!"
81+
>
82+
> ‒the reader and/or more sickos
83+
84+
Right—how could this be anything by loosey-goosey _senselessness_? I beg to differ; _BUPKIS_ is nothing if not _intentional_.
85+
86+
The first parameter to a _BUPKIS_ assertion is always the _subject_ ([def.](https://bupkis.zip/documents/Reference.Glossary_of_Terms#subject)).
6887

69-
The "string" part of an expectation is known as a _phrase_. Every expectation will contain, at minimum, one phrase. As you can see from the above example, phrases often have aliases.
88+
The "string" part of a _BUPKIS_ assertion is known as a _phrase_. Every expectation will contain _at minimum_ one (1) phrase. As you can see from the above "to be a string" example, phrases often have aliases.
7089

71-
You can negate just about any phrase:
90+
Assertions may have multiple phrases or parameters, but the simplest assertions always look like this:
91+
92+
```ts
93+
expect(subject, 'phrase');
94+
```
95+
96+
...and more complex assertions look like this:
97+
98+
```ts
99+
expect(subject, 'phrase', [parameter?, phrase?, parameter?, ...]);
100+
```
101+
102+
One more convention worth mentioning is _negation_.
103+
104+
You can _negate_ just about any phrase by prepending it with `not` and a space. For example:
72105
73106
```js
74107
expect(actual, 'to be', expected);
75-
// did they not teach grammar in nerd school??
76-
expect(actual, 'not is', expected);
108+
expect(actual, 'not to be', expected);
77109

78110
expect(
79111
() => throw new TypeError('aww, shucks'),
80-
'to throw a',
112+
'not to throw a',
81113
TypeError,
82-
'not satisfying',
114+
'satisfying',
83115
/gol durn/,
84116
);
85117
```
86118
87-
### Custom Assertions
119+
### Custom Assertions by Zod
88120
89-
In _BUPKIS_, custom assertions are _first-class citizens_. You can create your own assertions with minimal boilerplate. You don't have to learn a new API or a new DSL (maybe); you just use [Zod][]. _It's so easy, even a **archaic human** could do it!_
121+
[Zod][] is a popular object validation library which does some heavy lifting for _BUPKIS_. In fact, its fundamentals get us _most_ of the way to a type-safe assertion library!
90122
91-
Read [Guide: How to Create a Custom Assertion](https://boneskull.github.io/bupkis/documents/Guides.How_to_Create_a_Custom_Assertion) to learn more.
123+
So We recognized that many (most?) custom assertions can be _implemented as Zod schemas._
92124
93-
## Prerequisites
125+
Here's a ~~stupid~~ ~~quick~~ _stupid_ example of a creating and "registering" a basic assertion _which can be invoked using two different phrases_:
126+
127+
```ts
128+
import { z, use, createAssertion } from 'bupkis';
94129

95-
_BUPKIS_ requires **Node.js ^20.19.0 || ^22.12.0 || >=23** and ships as a dual CJS/ESM package.
130+
const stringAssertion = createAssertion(
131+
z.string(),
132+
[['to be based', 'to be bussin']],
133+
z.string(),
134+
);
96135

97-
The library has been designed for Node.js environments and testing frameworks.
136+
const { expect } = use([stringAssertion]);
98137

99-
## Installation
138+
expect('chat', 'to be based');
139+
expect('fam', 'to be bussin');
100140

101-
```bash
102-
npm install bupkis -D
141+
// did you know? includes all builtin assertions!
142+
expect('skiball lavatory', 'to be a string');
103143
```
104144
105-
## Usage
145+
**If you can express it in Zod, you can make it an assertion.** There's also a [function-based API][custom-assertion-function] for use with [parametric][] and behavioral assertions.
106146
107-
Here:
147+
👉 For a thorough guide on creating assertions, read [Guide: How to Create a Custom Assertion][create-a-custom-assertion].
108148
109-
```ts
110-
import { expect } from 'bupkis';
111-
112-
// Basic type assertions
113-
expect('hello', 'to be a string');
114-
expect(42, 'to be a number');
115-
expect(true, 'to be a boolean');
116-
117-
// Value comparisons
118-
expect(10, 'to equal', 10);
119-
expect('hello world', 'to contain', 'world');
120-
expect([1, 2, 3], 'to have length', 3);
121-
122-
// Negation
123-
expect(42, 'not to be a string');
124-
expect('hello', 'not to equal', 'goodbye');
125-
126-
// Object assertions
127-
const user = { name: 'Alice', age: 30 };
128-
expect(user, 'to be an object');
129-
expect(user, 'to have property', 'name');
130-
expect(user, 'to satisfy', { name: 'Alice' });
131-
```
149+
## Prerequisites
132150
133-
For comprehensive documentation and guides, visit the [project documentation](https://boneskull.github.io/bupkis/).
151+
**Node.js**: ^20.19.0, ^22.12.0, >=23
134152
135-
### Worth Mentioning Right Now
153+
_BUPKIS_ has a peer dependency on [Zod][] v4+, but will install it as an optional dependency if you are not already using it.
136154
137-
_BUPKIS_ has two main exports:
155+
_BUPKIS_ ships as a dual CJS/ESM package.
138156
139-
- `expect()`: the main entrypoint for synchronous assertions
140-
- `expectAsync()`: the main entrypoint for asynchronous assertions
157+
> Disclaimer: _BUPKIS_ has been designed to run on Node.js in a development environment. Anyone attempting to deploy _BUPKIS_ to some server somewhere will get what is coming to them.
141158
142-
> [!IMPORTANT]
143-
>
144-
> As of this writing, the assertions available in `expectAsync()` are all `Promise`-related (and custom assertions can even use an async schema for the subject); they are completely disjoint from the assertions available in `expect()`. **This will likely change in the future.**
159+
## Installation
145160
146-
## Project Scope
161+
```bash
162+
npm install bupkis -D
163+
```
147164
148-
1. It's an assertion library
165+
## Usage
149166
150-
## Prior Art & Appreciation
167+
👉 See the [Basic Usage Guide](https://bupkis.zip/documents/guides.basic_usage) for a quick introduction.
168+
169+
📖 Visit [https://bupkis.zip](https://bupkis.zip) for comprehensive guides and reference.
170+
171+
## Acknowledgements
151172
152173
- [Unexpected][] is the main inspiration for _BUPKIS_. However, creating types for this library is exceedingly difficult (and was in fact the first thing I tried). Despite that drawback, I find it more usable than any other assertion library I've tried.
153-
- [Zod][] is a popular object validation library which does most of the heavy lifting for _BUPKIS_. It's not an assertion library, but there's enough overlap in its use case that it makes sense to leverage it.
154-
- [fast-check][]: A big thanks to Nicholas Dubien for this library. There is **no better library** for an assertion library to use to test itself! Well, besides itself, I mean. How about _in addition to_ itself? Yes. Thank you!
174+
- [Zod][] is a popular object validation library upon which _BUPKIS_ builds many of its own assertions.
175+
- [fast-check][]: Thanks to Nicholas Dubien for this library. There is **no better library** for an assertion library to use to test itself! Well, besides itself, I mean. How about _in addition to_ itself? Yes. Thank you!
176+
- [tshy][] from Isaac Schlueter. Thanks for making dual ESM/CJS packages easy and not too fancy.
177+
- [TypeDoc][] it really documents the hell out of TypeScript projects.
178+
- [@cjihrig](https://github.com/cjihrig) and other Node.js contributors for the thoughtfulness put into [`node:test`](https://nodejs.org/api/test.html) that make it my current test-runner-of-choice.
179+
180+
## Why is it called _BUPKIS_?
181+
182+
TODO: think of good reason and fill in later
155183
156184
## A Note From The Author
157185
@@ -164,5 +192,13 @@ _BUPKIS_ has two main exports:
164192
Copyright © 2025 Christopher Hiller. Licensed under [BlueOak-1.0.0](https://blueoakcouncil.org/license/1.0.0).
165193
166194
[zod]: https://zod.dev
195+
[docs]: https://bupkis.zip
196+
[basic-usage]: https://bupkis.zip/documents/guides.basic_usage
167197
[unexpected]: https://unexpected.js.org
168198
[fast-check]: https://fast-check.dev
199+
[parametric]: https://bupkis.zip/documents/Reference.Glossary_of_Terms#parametric-assertion
200+
[custom-assertion-function]: https://bupkis.zip/documents/guides.how_to_create_a_custom_assertion#using-a-function
201+
[create-a-custom-assertion]: https://bupkis.zip/documents/Guides.How_to_Create_a_Custom_Assertion
202+
[assertion-reference]: https://bupkis.zip/documents/reference.assertions
203+
[tshy]: https://github.com/isaacs/tshy
204+
[typedoc]: https://typedoc.org

assets/Twentieth-Century-Bold.txt

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
23.1 KB
Binary file not shown.

assets/apple-touch-icon.png

5.7 KB
Loading

assets/bupkis-logo-1024.png

52.2 KB
Loading

assets/bupkis-logo-128.png

-15.3 KB
Binary file not shown.

assets/bupkis-logo-2048.png

-1.22 MB
Binary file not shown.

assets/bupkis-logo-256.png

-30.7 KB
Loading

0 commit comments

Comments
 (0)