Skip to content

Commit c434e4d

Browse files
committed
Merge branch 'docs/createDocs' into beta
2 parents c323329 + 6c26bc2 commit c434e4d

39 files changed

+12449
-41
lines changed

.github/CONTRIBUTING.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,13 @@ Must be one of the following:
4343
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
4444
* **revert**: Revert an commit
4545
* **dependencies**: Update field `dependencies` (/ `devDependencies`)
46-
* **release**: An Release Commit
46+
* **release**: A Release Commit
4747

4848
look into [releaserc](../.releaserc.js) for corresponding versions
4949

5050
### Scope
5151

52-
The scope could be anything specifying place of the commit change. For example `$location`,
53-
`$browser`, `$compile`, `$rootScope`, `ngHref`, `ngClick`, `ngView`, etc...
52+
The scope should be the file that got modified, if multiple files then use no scope.
5453

5554
You can use `*` when the change affects more than a single scope.
5655

@@ -102,3 +101,13 @@ If the interface/type/enum is an "standalone" then it should be named appropriat
102101

103102
Source file names should be `PascalCase` if the main export is an class (example: `MongoBinary`, and not `Mongo-Binary`)
104103
Source file names should be `camelCase` if there is no "definitive main export" (example: `resolveConfig` & `utils`)
104+
105+
## Documentation
106+
107+
If being new to markdown / docusaurus / Infima styling, look at the following sources:
108+
109+
* [Markdown Basics](https://guides.github.com/features/mastering-markdown/)
110+
* [Docusaurus](https://v2.docusaurus.io/docs/)
111+
* [Infima](https://facebookincubator.github.io/infima/) (is currently not up, needs to be run locally)
112+
113+
There is also an File in this project to view basic elements in the projects styles: [Test Page Source](../docs/test.md) [Test Page Website]() <!--TODO: replace with actual website-->

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v2
2323
if: github.event.inputs.git-ref == ''
24+
with:
25+
fetch-depth: 0 # always fetch everything to be sure for codecov
2426
- uses: actions/checkout@v2
2527
if: github.event.inputs.git-ref != ''
2628
with:
2729
ref: ${{ github.event.inputs.git-ref }}
30+
fetch-depth: 5 # because this is an manual trigger, only fetch the latest 5
2831
- name: Use Node.js ${{ matrix.node-version }}
2932
uses: actions/setup-node@v1
3033
with:

.github/workflows/website.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy Github Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- '!gh-pages'
8+
paths: # only run this deploy if an file in the following directories are changed
9+
- 'docs/**'
10+
- 'website/**'
11+
12+
jobs:
13+
website:
14+
runs-on: ubuntu-latest
15+
if: github.ref == 'refs/heads/master'
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js 14
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 14.x
22+
- name: Install & Build
23+
run: bash ./ghPagesPre.sh
24+
- name: Deploy to Github Pages
25+
uses: JamesIves/[email protected]
26+
with:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
BRANCH: gh-pages
29+
FOLDER: . # the root, because the provided script already moves files

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
* **MongoBinaryDownloadUrl:** add case for Linux Mint 20 ([01a6bc6](https://github.com/nodkz/mongodb-memory-server/commit/01a6bc63f0e13a4528ee39ccae64390a8de48582))
131131
* **MongoBinaryDownloadUrl:** detect "linuxmint" and "linux mint" as linux mint ([fda4f72](https://github.com/nodkz/mongodb-memory-server/commit/fda4f7224d156680ac68c743c5a5a963070171dd)), closes [#403](https://github.com/nodkz/mongodb-memory-server/issues/403)
132132
* **MongoBinaryDownloadUrl:** fix win32 download generation ([d62b489](https://github.com/nodkz/mongodb-memory-server/commit/d62b4891a01fe40b5f00c21ee02f08b24a55d80c)), closes [#399](https://github.com/nodkz/mongodb-memory-server/issues/399)
133-
* **MongoBinaryDownloadUrl:** getArchiveName: throw error if platform is unkown ([9fc358b](https://github.com/nodkz/mongodb-memory-server/commit/9fc358b9b2997333b2121eabff16e91e543f3897))
133+
* **MongoBinaryDownloadUrl:** getArchiveName: throw error if platform is unknown ([9fc358b](https://github.com/nodkz/mongodb-memory-server/commit/9fc358b9b2997333b2121eabff16e91e543f3897))
134134
* **MongoInstance:** handle code "12" on windows ([718aed7](https://github.com/nodkz/mongodb-memory-server/commit/718aed7281c25c7198ea068a87b06924d77de8ba)), closes [#411](https://github.com/nodkz/mongodb-memory-server/issues/411)
135135

136136

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Works perfectly [with Travis CI](https://github.com/nodkz/graphql-compose-mongoo
5252
- [Enable Debug Mode](#enable-debug-mode)
5353
- [CI](#ci)
5454
- [Contributing](#contributing)
55+
- [Join Our Discord Server](#join-our-discord-server)
56+
- [Documentation](#documentation)
5557
- [Credits](#credits)
5658
- [Maintainers](#maintainers)
5759
- [Contributors](#contributors)
@@ -576,6 +578,15 @@ script:
576578

577579
Contributing Guidelines are setup in [CONTRIBUTING](./.github/CONTRIBUTING.md)
578580

581+
## Join Our Discord Server
582+
583+
To ask questions or just talk with us, [join our Discord Server](https://discord.gg/BpGjTTD).
584+
585+
## Documentation
586+
587+
- [Documentation](https://nodkz.github.io/mongodb-memory-server/docs/api/index-api)
588+
- [Quick start guide](https://nodkz.github.io/mongodb-memory-server/docs/guides/quick-start-guide/)
589+
579590
## Credits
580591

581592
Inspired by alternative runners for [mongodb-prebuilt](https://github.com/winfinit/mongodb-prebuilt):

docs/api/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
id: index-api
3+
title: 'Welcome to the API'
4+
---
5+
6+
In `API` will be documented what functions & values do, even internal `protected` / `private` ones

docs/api/mongobinary.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: mongo-binary
3+
title: 'MongoBinary'
4+
---
5+
6+
API Documentation of `MongoBinary`-Class
7+
8+
## Functions
9+
10+
:::note
11+
This class is not actually meant to be constructed, it only consists of static functions & values
12+
:::
13+
14+
### getSystemPath
15+
16+
Typings: `static async getSystemPath(systemBinary: string): Promise<string | undefined>`
17+
18+
Try to stat the given `systemBinary` path, and return it if successfull, otherwise `undefined`
19+
20+
### getDownloadPath
21+
22+
Typings: `static async getDownloadPath(options: Required<MongoBinaryOpts>): Promise<string>`
23+
24+
Get an binary from cache or download it
25+
26+
### getPath
27+
28+
Typings: `static async getPath(opts: MongoBinaryOpts = {}): Promise<string>`
29+
30+
Get an working binary and returns the path to it<br/>
31+
(Calls [`getDownloadPath`](#getdownloadpath))
32+
33+
## Values
34+
35+
### cache
36+
37+
Typings: `static cache: Map<string, string>`
38+
39+
Global Cache for binaries

docs/api/mongoinstance.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
---
2+
id: mongo-instance
3+
title: 'MongoInstance'
4+
---
5+
6+
API Documentation of `MongoInstance`-Class
7+
8+
## Functions
9+
10+
### new
11+
12+
Typings: `constructor(opts: Partial<MongodOpts>)`
13+
14+
Create an new Instance without starting it
15+
16+
:::tip
17+
When directly starting the instance, [`run`](#static-run) should be used
18+
:::
19+
20+
### debug
21+
22+
Typings: `private debug(msg: string): void`
23+
24+
Format input with debug-message template
25+
26+
### static-run
27+
28+
Typings: `static async run(opts: Partial<MongodOpts>): Promise<MongoInstance>`
29+
30+
Create an new Instance and start it (while being an Promise)
31+
32+
### prepareCommandArgs
33+
34+
Typings: `prepareCommandArgs(): string[]`
35+
36+
Constructs the Command Arguments
37+
38+
### run
39+
40+
Typings: `async run(): Promise<this>`
41+
42+
Start the `mongod` process
43+
44+
### kill
45+
46+
Typings: `async kill(): Promise<MongoInstance>`
47+
48+
Stop the `mongod` process
49+
50+
:::caution
51+
Will not Error if instance is not running
52+
:::
53+
54+
### _launchMongod
55+
56+
<span class="badge badge--warning">Internal</span>
57+
58+
Typings: `_launchMongod(mongoBin: string): ChildProcess`
59+
60+
Actually spawn the `mongod` process with `ChildProcess`, used by [`run`](#run)
61+
62+
### _launchKiller
63+
64+
<span class="badge badge--warning">Internal</span>
65+
66+
Typings: `_launchKiller(parentPid: number, childPid: number): ChildProcess`
67+
68+
Spawn an killer process that keeps watch over the `mongod` process
69+
70+
### errorHandler
71+
72+
<span class="badge badge--warning">Internal</span>
73+
74+
Typings: `errorHandler(err: string): void`
75+
76+
Error handler for the `mongod` process
77+
78+
### closeHandler
79+
80+
<span class="badge badge--warning">Internal</span>
81+
82+
Typings: `closeHandler(code: number): void`
83+
84+
Close handler for the `mongod` process
85+
86+
### stderrHandler
87+
88+
<span class="badge badge--warning">Internal</span>
89+
90+
Typings: `stderrHandler(message: string | Buffer): void`
91+
92+
STDERR handler for the `mongod` process
93+
94+
### stdoutHandler
95+
96+
<span class="badge badge--warning">Internal</span>
97+
98+
Typings: `stdoutHandler(message: string | Buffer): void`
99+
100+
STDOUT handler for the `mongod` process<br/>
101+
Matches process output against known formats and raise events
102+
103+
## Values
104+
105+
### instanceOpts
106+
107+
Typings: `instanceOpts: MongoInstanceOpts`
108+
109+
Stores the Instance Options
110+
111+
### binaryOpts
112+
113+
Typings: `readonly binaryOpts: Readonly<MongoBinaryOpts>`
114+
115+
Stores the Binary Options
116+
117+
### spawnOpts
118+
119+
Typings: `readonly spawnOpts: Readonly<SpawnOptions>`
120+
121+
Stores the Spawn Options
122+
123+
### childProcess
124+
125+
<span class="badge badge--warning">Internal</span>
126+
127+
Typings: `childProcess?: ChildProcess`
128+
129+
Stores the active process reference for the `mongod` process
130+
131+
### killerProcess
132+
133+
<span class="badge badge--warning">Internal</span>
134+
135+
Typings: `killerProcess?: ChildProcess`
136+
137+
Stores the active process reference for the killer process
138+
139+
### isInstancePrimary
140+
141+
Typings: `isInstancePrimary: boolean`
142+
143+
Stores that the process is an Primary (ReplSet)
144+
145+
### isInstanceReady
146+
147+
Typings: `isInstanceReady: boolean`
148+
149+
Stores that the process is fully started
150+
151+
### isReplSet
152+
153+
Typings: `isReplSet: boolean`
154+
155+
Stores that the process is in an ReplSet

0 commit comments

Comments
 (0)