Skip to content

Commit 178fe09

Browse files
authored
docs(gh-pages): Standard documentation and GH pages setup (#45)
1 parent 8a3c594 commit 178fe09

File tree

9 files changed

+239
-65
lines changed

9 files changed

+239
-65
lines changed

.github/workflows/pages.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Deploy GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["release"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Install NodeJS
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version-file: '.nvmrc'
28+
29+
- name: Install Yarn
30+
run: npm install -g yarn
31+
32+
- name: Cache dependencies
33+
uses: actions/cache@v3
34+
with:
35+
path: .yarn/cache
36+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-yarn-
39+
40+
- name: Install dependencies
41+
run: yarn install --immutable
42+
43+
- name: Build API Reference
44+
run: yarn pages
45+
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v1
48+
49+
- name: Build with Jekyll
50+
uses: actions/jekyll-build-pages@v1
51+
with:
52+
source: ./
53+
destination: ./_site
54+
55+
- name: Upload artifact
56+
uses: actions/upload-pages-artifact@v1
57+
58+
deploy:
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
runs-on: ubuntu-latest
63+
needs: build
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v1

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Stack Builders
3+
Copyright (c) 2022 Stack Builders Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+45-12
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,69 @@
1-
# AssertiveTS
21
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
32
[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-)
43
<!-- ALL-CONTRIBUTORS-BADGE:END -->
54

6-
A type-safe fluent assertion library inspired by [Jest](https://jestjs.io/docs/expect) assertions and the popular [AssertJ](https://assertj.github.io/doc/).
5+
# AssertiveTS
6+
7+
A type-safe fluent assertion library written in TypeScript and inspired by [Jest](https://jestjs.io/docs/expect) assertions and the popular [AssertJ](https://assertj.github.io/doc/).
8+
9+
This library is designed to work in the browser and in Node.js. It ships with a rich set of expressive and flexible matchers that allows chaining multiple assertions. AssertiveTS is framework agnostic and should be used with a test framework such as [Jest](/docs/jest-tutorial.md), [Mocha](/docs/mocha-tutorial.md), or Ava.
10+
11+
## Type-safe library
12+
13+
A distinctive feature of AssertiveTS with other assertion libraries is that it leverages the TypeScript compiler to avoid type coercions and mismatches. It also infers the static type of the value you want to assert and provides you with intelligent matcher completion and signature help so that you can write code more quickly and correctly.
14+
15+
### Features
16+
17+
- Type safety and intelligent matcher completion
18+
- Rich set of expressive and flexible matchers
19+
- Concise, chainable interface inspired by AssertJ
20+
- Works with any test runner and framework such as [Jest](/docs/jest-tutorial.md), [Mocha](/docs/mocha-tutorial.md), or Ava
21+
- Well tested: more than 300 tests!
722

823
## Install
9-
```
24+
25+
```sh
1026
npm install --save-dev @stackbuilders/assertive-ts
1127
```
28+
1229
Or:
13-
```
30+
31+
```sh
1432
yarn add --dev @stackbuilders/assertive-ts
1533
```
1634

1735
## Usage
1836

1937
Import the library in your test script:
20-
```typescript
38+
39+
```ts
2140
import { expect } from "@stackbuilders/assertive-ts"
2241
```
2342

2443
Use the `expect` function along with a "matcher" function on the value you want to assert:
25-
```typescript
44+
45+
```ts
2646
expect(sum(1, 2)).toBeEqual(3);
2747
```
2848

2949
To assert the opposite, just add `.not` before a matcher:
30-
```typescript
50+
51+
```ts
3152
expect(sum(1, 2)).not.toBeNull();
3253
```
3354

3455
With `assertive-ts` you can use **fluent assertions**, which means you can chain multiple matcher functions to the same value under test:
35-
```typescript
56+
57+
```ts
3658
expect("assertive-ts is awesome!")
3759
.toStartWith("assertive-ts")
3860
.not.toContain("unsafe")
3961
.toEndWith("awesome!");
4062
```
4163

4264
The matcher functions depend on the type of the value on the `expect`. If you're using TypeScript, the compiler will let you know if something is not available for that assertion:
43-
```typescript
65+
66+
```ts
4467
// Boolean assertion
4568
expect(isEven(2)).toBeTrue();
4669

@@ -54,15 +77,16 @@ expect(14).toEndWith("4");
5477
^ ? type error: `toEndWith` does not exist in `NumberAssertion`
5578
```
5679

57-
For a list of all matchers and extended documentation, please refer to the API documentation.
80+
For a list of all matchers and extended documentation, please refer to the [API documentation](https://stackbuilders.github.io/assertive-ts/docs/build/).
5881

5982
## Test Runner Integration
6083

6184
- [Jest Integration](docs/jest-tutorial.md)
6285
- [Mocha Integration](docs/mocha-tutorial.md)
6386

6487
## API Reference
65-
You can find the full API reference [here](/docs/pages/index.html)
88+
89+
You can find the full API reference [here](https://stackbuilders.github.io/assertive-ts/docs/build/)
6690

6791
## Contributors ✨
6892

@@ -91,4 +115,13 @@ This project follows the [all-contributors](https://github.com/all-contributors/
91115

92116
## License
93117

94-
[MIT License](https://github.com/stackbuilders/assertive-ts/blob/master/LICENSE)
118+
MIT, see [the LICENSE file](LICENSE).
119+
120+
## Contributing
121+
122+
Do you want to contribute to this project? Please take a look at our [contributing guideline](/docs/CONTRIBUTING.md) to know how you can help us build it.
123+
124+
---
125+
<img src="https://www.stackbuilders.com/media/images/Sb-supports.original.png" alt="Stack Builders" width="50%" />
126+
127+
[Check out our libraries](https://github.com/stackbuilders/) | [Join our team](https://www.stackbuilders.com/join-us/)

_config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
remote_theme: chrisrhymes/bulma-clean-theme
2+
3+
defaults:
4+
- scope:
5+
path: ""
6+
values:
7+
title: AssertiveTS
8+
subtitle: A type-safe fluent assertion library

docs/CODE_OF_CONDUCT.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Code of conduct
2+
3+
## Purpose
4+
The primary goal of this Code of Conduct is to enable an open and welcoming environment. We pledge to making participation in our project a harassment-free experience for everyone, regardless of gender, sexual
5+
orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).
6+
7+
## General recommendations
8+
Examples of behavior that contributes to creating a positive environment include:
9+
10+
- Using welcoming and inclusive language
11+
- Being respectful of differing viewpoints and experiences
12+
- Gracefully accepting constructive criticism
13+
- Focusing on what is best for the community
14+
- Showing empathy towards other community members
15+
16+
Examples of unacceptable behavior by participants include:
17+
18+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
19+
- Trolling, insulting/derogatory comments, and personal or political attacks
20+
- Public or private harassment
21+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
22+
- Other conduct which could reasonably be considered inappropriate in a professional setting
23+
24+
## Maintainer responsibilities
25+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
26+
27+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
28+
29+
## Scope
30+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
31+
32+
## Enforcement
33+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [[email protected]](mailto:[email protected]). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
34+
35+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

docs/CONTRIBUTING.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Thank you for your interest in contributing to this Stack Builders' library. To contribute, please take our [Code of Conduct](CODE_OF_CONDUCT.md) into account, along with the following recommendations:
2+
3+
- When submitting contributions to this repository, please make sure to discuss with the maintainer(s) the change you want to make. You can do this through an issue, or by sending an email to [[email protected]](mailto:[email protected])
4+
5+
- Once the change has been discussed with the maintainer(s), feel free to open a Pull Request. Please include a link to the issue you're trying to solve, or a quick summary of the discussed changes.
6+
7+
- If adding any new features that you think should be considered in the README file, please add that information in your Pull Request.
8+
9+
- Once you get an approval from any of the maintainers, please merge your Pull Request. Keep in mind that some of our Stack Builders repositories use CI/CD pipelines, so you will need to pass all of the required checks before merging.
10+
11+
## Getting help
12+
Contact any of our current maintainers, or send us an email at [[email protected]](mailto:[email protected]) for more information. Thank you for contributing!

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"ts-node": "^10.9.1",
3333
"tslint": "^6.1.3",
3434
"typedoc": "^0.23.9",
35+
"typedoc-plugin-markdown": "^3.13.4",
3536
"typedoc-plugin-merge-modules": "^4.0.1",
36-
"typedoc-theme-hierarchy": "^3.0.0",
3737
"typescript": "^4.7.4"
3838
},
3939
"packageManager": "[email protected]"

typedoc.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
2-
"cleanOutputDir": false,
2+
"$schema": "https://typedoc.org/schema.json",
3+
"cleanOutputDir": true,
34
"entryPoints": ["src/lib"],
45
"entryPointStrategy": "expand",
5-
"githubPages": true,
6-
"includeVersion": true,
6+
"gitRevision": "release",
7+
"githubPages": false,
8+
"hideGenerator": true,
9+
"includeVersion": false,
710
"mergeModulesMergeMode": "project",
811
"mergeModulesRenameDefaults": true,
9-
"name": "assertive-ts",
12+
"name": "AssertiveTS - API Reference",
1013
"out": "docs/build",
1114
"plugin": [
12-
"typedoc-theme-hierarchy",
15+
"typedoc-plugin-markdown",
1316
"typedoc-plugin-merge-modules"
1417
],
1518
"readme": "none",
16-
"theme": "hierarchy",
1719
"visibilityFilters": {
1820
"@alpha": false,
1921
"@beta": false,

0 commit comments

Comments
 (0)