Skip to content

Commit e2421a9

Browse files
committed
feat: 0.2.0
1 parent e1de794 commit e2421a9

File tree

97 files changed

+4374
-1218
lines changed

Some content is hidden

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

97 files changed

+4374
-1218
lines changed

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{js,json,yml}]
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 2

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.yarn/** linguist-vendored
2+
/.yarn/releases/* binary
3+
/.yarn/plugins/**/* binary
4+
/.pnp.* binary linguist-generated

.gitignore

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
dist/
2-
node_modules/
1+
.yarn/*
2+
!.yarn/patches
3+
!.yarn/plugins
4+
!.yarn/releases
5+
!.yarn/sdks
6+
!.yarn/versions
7+
8+
# Swap the comments on the following lines if you wish to use zero-installs
9+
# In that case, don't forget to run `yarn config set enableGlobalCache false`!
10+
# Documentation here: https://yarnpkg.com/features/zero-installs
11+
12+
#!.yarn/cache
13+
.pnp.*
14+
15+
node_modules
16+
17+
dist

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules\\typescript\\lib"
3+
}

.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

CODE_OF_CONDUCT.md

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at [email protected]
63+
.
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Contributing
2+
3+
Thank you for showing interests in contributing to this project. Please follow this guide before contributing to this project.
4+
5+
## Don't know where to start?
6+
7+
If you dont know from where to start, check the issue tracker.
8+
9+
## Check for existing PRs
10+
11+
Before making a pull request, make sure to check if someone else has already made a PR for that specific topic. Avoid duplicated PRs.
12+
13+
## Commits
14+
15+
Follow [conventional commits](https://www.conventionalcommits.org/en) format while committing. Conventional commit dovetails with semver, by describing the features, fixes, and breaking changes made in commit messages. The following specification is adapted from [conventionalcommits.org](https://www.conventionalcommits.org/en).
16+
17+
The commit message should be structured as follows:
18+
19+
```text
20+
<type>[optional scope]: <description>
21+
22+
[optional body]
23+
24+
[optional footer]
25+
```
26+
27+
##### The commit contains the following structural elements, to communicate intent to the consumers of your library:
28+
29+
1. `fix`: a commit of the type fix patches a bug in your codebase (this correlates with `PATCH` in semantic versioning).
30+
2. `feat`: a commit of the type feat introduces a new feature to the codebase (this correlates with `MINOR` in semantic versioning).
31+
3. `BREAKING CHANGE`: a commit that has the text `BREAKING CHANGE`: at the beginning of its optional body or footer section introduces a breaking API change (correlating with MAJOR in semantic versioning). A `BREAKING CHANGE` can be part of commits of any type.
32+
4. Others: commit types other than `fix:` and `feat:` are allowed, for example [@commitlint/config-conventional](https://npm.im/@commitlint/config-conventional) (based on the [Angular convention](https://github.com/angular/angular/blob/68a6a07/CONTRIBUTING.md#commit)) recommends `chore:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`, and others.
33+
34+
### Examples
35+
#### Commit message with description and breaking change in body
36+
37+
```text
38+
feat: allow provided config object to extend other configs
39+
40+
BREAKING CHANGE: `extends` key in config file is now used for extending other config files
41+
```
42+
43+
#### Commit message with optional `!` to draw attention to breaking change
44+
45+
```text
46+
chore!: drop Node 6 from testing matrix
47+
48+
BREAKING CHANGE: dropping Node 6 which hits end of life in April
49+
```
50+
51+
#### Commit message with no body
52+
53+
```text
54+
docs: correct spelling of CHANGELOG
55+
```
56+
57+
#### Commit message with scope
58+
59+
```text
60+
feat(lang): add polish language
61+
```
62+
63+
#### Commit message for a fix using an (optional) issue number.
64+
65+
```text
66+
fix: correct minor typos in code
67+
68+
see the issue for details on the typos fixed
69+
70+
closes issue #12
71+
```
72+
73+
### Specification
74+
75+
The key words `“MUST”`, `“MUST NOT”`, `“REQUIRED”`, `“SHALL”`, `“SHALL NOT”`, `“SHOULD”`, `“SHOULD NOT”`, `“RECOMMENDED”`, `“MAY”`, and `“OPTIONAL”` in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
76+
77+
1. Commits MUST be prefixed with a type, which consists of a noun, `feat`, `fix`, etc., followed by an OPTIONAL scope, and a REQUIRED terminal colon and space.
78+
2. The type `feat` MUST be used when a commit adds a new feature to your application or library.
79+
3. The type `fix` MUST be used when a commit represents a bug fix for your application.
80+
4. A scope MAY be provided after a type. A scope MUST consist of a noun describing a section of the codebase surrounded by parenthesis, e.g., `fix(parser):`
81+
5. A description MUST immediately follow the space after the type/scope prefix. The description is a short summary of the code changes, e.g., `fix: array parsing issue when multiple spaces were contained in string`.
82+
6. A longer commit body MAY be provided after the short description, providing additional contextual information about the code changes. The body MUST begin one blank line after the description.
83+
7. A footer of one or more lines MAY be provided one blank line after the body. The footer MUST contain meta-information about the commit, e.g., related pull-requests, reviewers, breaking changes, with one piece of meta-information per-line.
84+
8. Breaking changes MUST be indicated at the very beginning of the body section, or at the beginning of a line in the footer section. A breaking change MUST consist of the uppercase text `BREAKING CHANGE`, followed by a colon and a space.
85+
9. A description MUST be provided after the `BREAKING CHANGE:`, describing what has changed about the API, e.g., `BREAKING CHANGE: environment variables now take precedence over config files`.
86+
10. Types other than `feat` and `fix` MAY be used in your commit messages.
87+
11. The units of information that make up conventional commits MUST NOT be treated as case sensitive by implementors, with the exception of `BREAKING CHANGE` which MUST be uppercase.
88+
12. A `!` MAY be appended prior to the `:` in the type/scope prefix, to further draw attention to breaking changes. `BREAKING CHANGE: description` MUST also be included in the body or footer, along with the `!` in the prefix.
89+
90+
## Formatting, Linting, Testing
91+
92+
Make sure to properly format the source code, check for linter errors and test the code before pushing.
93+
94+
## File Names
95+
96+
1. Use `PascalCase` format if the file belongs to a class. Ex: `NobuBrowser.ts`, `ProtocolService.ts`, etc.
97+
2. Use `camelCase` format for the files that belong to functions. Ex: `contextMenu`, `appMenu`, etc.
98+
3. Use `lowercase` format for other cases.
99+
100+
> 🎉 Happy coding!

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Neplex Technologies
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+27-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
1-
# `micro-docgen`
1+
# micro-docgen
22

3-
Simple documentation generator for TypeScript projects.
3+
TypeScript documentation generator on steroids 💉. MicroDocgen is built on top of typedoc to leverage its power and add more features.
44

5-
> ⚠️ **WIP!! Currently only supports class & function serialization**
5+
## TODO
66

7-
# Example
7+
- Static site generation
8+
- More options
89

9-
```js
10-
const { Docgen } = require('micro-docgen');
11-
const docgen = new Docgen();
12-
const fs = require('fs');
10+
## Installation
11+
12+
```sh
13+
$ npm install micro-docgen
14+
```
1315

14-
// add source file(s)
15-
docgen.addFiles('./src/*.ts');
16+
## Usage
1617

17-
// Generate json
18-
const documentation = docgen.generate();
18+
```js
19+
import { createDocumentation } from 'micro-docgen';
1920

20-
// write the output to docs.json
21-
fs.writeFileSync('./docs.json', JSON.stringify(documentation, null, '\t'));
21+
await createDocumentation({
22+
// source files
23+
input: ['src'],
24+
// output directory
25+
output: 'docs',
26+
// tsconfig path
27+
tsconfigPath: './tsconfig.json',
28+
// to generate markdown files
29+
markdown: true,
30+
// to generate json file
31+
jsonName: 'docs.json',
32+
// include custom files such as readme
33+
custom: [...]
34+
});
2235
```

docs/classes/AbstractSerializer.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## AbstractSerializer
2+
3+
```typescript
4+
new AbstractSerializer(declaration);
5+
```
6+
7+
| Parameter | Type | Optional |
8+
| ----------- | --------------------- | -------- |
9+
| declaration | DeclarationReflection ||
10+
11+
## Properties
12+
13+
### public declaration: any
14+
15+
## Methods
16+
17+
### public serialize(): [void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)

0 commit comments

Comments
 (0)