Skip to content

Commit 941f62a

Browse files
authored
Merge pull request #1 from golevelup/master
Sync upstream
2 parents a9f6f62 + 6cf76c6 commit 941f62a

File tree

106 files changed

+5368
-7536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+5368
-7536
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
# Build job
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
31+
- uses: pnpm/action-setup@v3
32+
with:
33+
version: 9
34+
- name: Setup Node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 20
38+
cache: pnpm
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v5
41+
- name: Install dependencies
42+
run: pnpm i
43+
- name: Build Docs
44+
run: pnpm docs:build
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: docs/.vitepress/dist
49+
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
needs: build
55+
runs-on: ubuntu-latest
56+
name: Deploy
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ packages/testing/*/lib
66
.idea
77
coverage/
88
tsconfig.build.tsbuildinfo
9-
integration/rabbitmq/dist
9+
integration/rabbitmq/dist
10+
11+
# doc ignored directories
12+
docs/.vitepress/dist
13+
docs/.vitepress/cache

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"editor.formatOnSave": true,
3-
"cSpell.words": ["rabbitmq", "Vitest"],
3+
"cSpell.words": ["Hasura", "rabbitmq", "Vitest"],
44
"typescript.tsdk": "node_modules/typescript/lib"
55
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ A collection of Badass modules and utilities to help you level up your NestJS ap
1919
| [`@golevelup/nestjs-graphql-request`](./packages/graphql-request) | Dependency Injection for GraphQLClient. Make type safe requests to third party GQL APIs | [![version](https://img.shields.io/npm/v/@golevelup/nestjs-graphql-request.svg)](https://www.npmjs.com/package/@golevelup/nestjs-graphql-request) | [changelog](./packages/graphql-request/CHANGELOG.md) |
2020
| [`@golevelup/nestjs-webhooks`](./packages/webhooks) | Middlewares and helpers for processing webhooks | [![version](https://img.shields.io/npm/v/@golevelup/nestjs-webhooks.svg)](https://www.npmjs.com/package/@golevelup/nestjs-webhooks) | [changelog](./packages/webhooks/CHANGELOG.md) |
2121
| [`@golevelup/nestjs-stripe`](./packages/stripe) | Stripe client and webhook processing | [![version](https://img.shields.io/npm/v/@golevelup/nestjs-stripe.svg)](https://www.npmjs.com/package/@golevelup/nestjs-stripe) | [changelog](./packages/stripe/CHANGELOG.md) |
22-
| [`@golevelup/ts-jest`](./packages/testing) | Jest utilities for making testing NestJS applications easier. | [![version](https://img.shields.io/npm/v/@golevelup/ts-jest.svg)](https://www.npmjs.com/package/@golevelup/ts-jest) | [changelog](./packages/testing/CHANGELOG.md) |
22+
| [`@golevelup/ts-jest`](./packages/testing) | Jest utilities for making testing NestJS applications easier. | [![version](https://img.shields.io/npm/v/@golevelup/ts-jest.svg)](https://www.npmjs.com/package/@golevelup/ts-jest) | [changelog](./packages/testing/CHANGELOG.md) |
2323

2424
## Contribute
2525

26-
Contributions welcome! Read the [contribution guidelines](CONTRIBUTING.md) first.
26+
Contributions welcome! Read the [contribution guidelines](./docs/contributing.md) first.
2727

2828
## License
2929

docker-compose.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
version: "3.5"
2-
31
services:
42
rabbit:
5-
image: "rabbitmq:management"
3+
image: 'rabbitmq:management'
64
environment:
7-
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
8-
RABBITMQ_DEFAULT_USER: "rabbitmq"
9-
RABBITMQ_DEFAULT_PASS: "rabbitmq"
10-
RABBITMQ_DEFAULT_VHOST: "/"
5+
RABBITMQ_ERLANG_COOKIE: 'SWQOKODSQALRPCLNMEQG'
6+
RABBITMQ_DEFAULT_USER: 'rabbitmq'
7+
RABBITMQ_DEFAULT_PASS: 'rabbitmq'
8+
RABBITMQ_DEFAULT_VHOST: '/'
119
ports:
12-
- "15672:15672"
13-
- "5672:5672"
10+
- '15672:15672'
11+
- '5672:5672'
1412
tty: true

docs/.vitepress/config.mts

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { defineConfig } from 'vitepress';
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: 'Golevelup Documentation',
6+
description:
7+
'A collection of badass modules and utilities to help you level up your NestJS applications',
8+
base: '/nestjs/',
9+
themeConfig: {
10+
// https://vitepress.dev/reference/default-theme-config
11+
nav: [
12+
{ text: 'Home', link: '/' },
13+
{ text: 'Documentation', link: '/what-is-golevelup-nestjs' },
14+
],
15+
16+
sidebar: [
17+
{
18+
text: 'Introduction',
19+
items: [
20+
{
21+
text: 'What is @golevelup/nestjs?',
22+
link: '/what-is-golevelup-nestjs',
23+
},
24+
],
25+
},
26+
{
27+
text: 'Modules',
28+
items: [
29+
{
30+
text: 'Hasura',
31+
link: '/modules/hasura',
32+
},
33+
{
34+
text: 'RabbitMQ',
35+
link: '/modules/rabbitmq',
36+
},
37+
{
38+
text: 'Stripe',
39+
link: '/modules/stripe',
40+
},
41+
],
42+
},
43+
{
44+
text: 'Utilities',
45+
items: [
46+
{
47+
text: 'Discovery',
48+
link: '/discovery',
49+
},
50+
{
51+
text: 'GraphQL Request',
52+
link: '/graphql-request',
53+
},
54+
{
55+
text: 'Common',
56+
link: '/common',
57+
},
58+
{
59+
text: 'Modules',
60+
link: '/modules',
61+
},
62+
{
63+
text: 'Webhooks',
64+
link: '/webhooks',
65+
},
66+
],
67+
},
68+
{
69+
text: 'Testing',
70+
items: [
71+
{
72+
text: 'Jest',
73+
link: '/testing/ts-jest',
74+
},
75+
{
76+
text: 'Sinon',
77+
link: '/testing/ts-sinon',
78+
},
79+
{
80+
text: 'Vitest',
81+
link: '/testing/ts-vitest',
82+
},
83+
],
84+
},
85+
{
86+
text: 'Contributing',
87+
link: '/contributing',
88+
},
89+
],
90+
91+
socialLinks: [
92+
{ icon: 'github', link: 'https://github.com/golevelup/nestjs' },
93+
],
94+
},
95+
});

docs/api-examples.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Runtime API Examples
6+
7+
This page demonstrates usage of some of the runtime APIs provided by VitePress.
8+
9+
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
10+
11+
```md
12+
<script setup>
13+
import { useData } from 'vitepress'
14+
15+
const { theme, page, frontmatter } = useData()
16+
</script>
17+
18+
## Results
19+
20+
### Theme Data
21+
22+
<pre>{{ theme }}</pre>
23+
24+
### Page Data
25+
26+
<pre>{{ page }}</pre>
27+
28+
### Page Frontmatter
29+
30+
<pre>{{ frontmatter }}</pre>
31+
```
32+
33+
<script setup>
34+
import { useData } from 'vitepress'
35+
36+
const { site, theme, page, frontmatter } = useData()
37+
</script>
38+
39+
## Results
40+
41+
### Theme Data
42+
43+
<pre>{{ theme }}</pre>
44+
45+
### Page Data
46+
47+
<pre>{{ page }}</pre>
48+
49+
### Page Frontmatter
50+
51+
<pre>{{ frontmatter }}</pre>
52+
53+
## More
54+
55+
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1-
# @golevelup/nestjs-common
1+
# Common
22

3-
<p align="center">
3+
Utility functions and low level reusable modules that provide building blocks for the @nestjs ecosystem.
4+
5+
<div style="display: flex; gap: 10px;">
46
<a href="https://www.npmjs.com/package/@golevelup/nestjs-common"><img src="https://img.shields.io/npm/v/@golevelup/nestjs-common.svg?style=flat" alt="version" /></a>
57
<a href="https://www.npmjs.com/package/@golevelup/nestjs-common"><img alt="downloads" src="https://img.shields.io/npm/dt/@golevelup/nestjs-common.svg?style=flat"></a>
68
<img alt="license" src="https://img.shields.io/npm/l/@golevelup/nestjs-common.svg">
7-
</p>
9+
</div>
10+
11+
## Getting Started
12+
13+
::: code-group
14+
15+
```bash [npm]
16+
npm install ---save @golevelup/nestjs-common
17+
```
18+
19+
```bash [yarn]
20+
yarn add @golevelup/nestjs-common
21+
```
822

9-
Utility functions and low level reusable modules that provide building blocks for the @levelup-nestjs and @nestjs ecosystem.
23+
```bash [pnpm]
24+
pnpm add @golevelup/nestjs-common
25+
```
26+
27+
:::
1028

1129
## Inject Decorator Factory (makeInjectableDecorator)
1230

@@ -17,12 +35,4 @@ to consume
1735

1836
## Mixins
1937

20-
The mixin pattern is particularly useful with NestJS components like `Interceptors` as a mechanism to provide both configuration while still allowing the component to participate with Nest's `Dependency Injection`.
21-
22-
## Contribute
23-
24-
Contributions welcome! Read the [contribution guidelines](../../CONTRIBUTING.md) first.
25-
26-
## License
27-
28-
[MIT License](../../LICENSE)
38+
The mixin pattern is particularly useful with NestJS components like `Interceptors` as a mechanism to provide both configuration while still a

CONTRIBUTING.md renamed to docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This project enforces good Git Tree management through awesome open source tools
1111
Don't worry, you don't have to go figure out how these tools work under the hood if you don't want to. As a contributor they're actually incredibly easy to work with! Just understand that this unlocks some cool super powers for the community.
1212

1313
- [x] Super clean git tree history so that it's easy to pinpoint why and where changes happened :evergreen_tree:
14-
- [x] [Automatic Changelog generation](CHANGELOG.md) :rocket:
14+
- [x] Automatic Changelog generation :rocket:
1515

1616
# Instructions
1717

0 commit comments

Comments
 (0)