Skip to content

Commit 16b9e89

Browse files
committed
feat(api): Add injectable documentation page
1 parent 2855dd4 commit 16b9e89

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
path = sources/nest
33
url = https://github.com/BrunnerLivio/nest
44
branch=fix/jsdoc-comments
5+
[submodule "sources/terminus"]
6+
path = sources/terminus
7+
url = https://github.com/nestjs/terminus
8+
branch = feature/api-docs

compiler/api/index.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ const jsdocPackage = require('dgeni-packages/jsdoc');
66
const nunjucksPackage = require('dgeni-packages/nunjucks');
77
const typeScriptPackage = require('dgeni-packages/typescript');
88

9-
const PROJECT_ROOT = resolve(__dirname, '../../sources/nest/');
10-
const API_SOURCE_PATH = resolve(PROJECT_ROOT, 'packages');
9+
const PROJECT_ROOT = resolve(__dirname, '../../sources/');
1110
const OUTPUT_PATH = resolve(__dirname, '../../src/generated/docs/api');
1211

1312
const nestjs = new Package('nestjs', [
@@ -28,17 +27,17 @@ const nestjs = new Package('nestjs', [
2827

2928
.config(function(readTypeScriptModules, tsParser) {
3029
// Tell TypeScript how to load modules that start with with `@nestjs`
31-
tsParser.options.paths = { '@nestjs/*': [API_SOURCE_PATH + '/*'] };
30+
tsParser.options.paths = { '@nestjs/*': [PROJECT_ROOT + '/*'] };
3231
tsParser.options.baseUrl = '.';
3332

3433
// API files are typescript
35-
readTypeScriptModules.basePath = API_SOURCE_PATH;
34+
readTypeScriptModules.basePath = PROJECT_ROOT;
3635

37-
readTypeScriptModules.sourceFiles = ['./core/index.ts', './common/index.ts'];
36+
readTypeScriptModules.sourceFiles = ['./nest/packages/core/index.ts', './nest/packages/common/index.ts', './terminus/lib/index.ts'];
3837
})
3938
.config(function(readFilesProcessor) {
4039
readFilesProcessor.$enabled = false;
41-
readFilesProcessor.basePath = API_SOURCE_PATH;
40+
readFilesProcessor.basePath = PROJECT_ROOT;
4241
})
4342
.config(function(parseTagsProcessor, getInjectables, tsHost) {
4443
// Load up all the tag definitions in the tag-defs folder
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
<h1>{$ doc.name $}</h1>
2-
<p>{$ doc.tags.description $} </p>
1+
{% extends 'export-base.template.html' -%}
32

4-
An injectable
3+
{% block overview %}
4+
{% include "includes/class-overview.html" %}
5+
{% endblock %}
6+
{% block details %}
7+
{% include "includes/description.html" %}
8+
{% include "includes/class-members.html" %}
9+
{% endblock %}

compiler/api/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"moduleResolution": "node",
99
"emitDecoratorMetadata": true,
1010
"experimentalDecorators": true,
11+
"sourceMap": true,
1112
"target": "es2018",
1213
"lib": [
1314
"es2018",

sources/terminus

Submodule terminus added at 054550e

0 commit comments

Comments
 (0)