Skip to content

Commit 634412f

Browse files
authored
Updated doc generator for browser API (#273)
* Added doc generation for browser API * fix tsconfig-browser.json * added index for both docs * update typedoc file * Install the crt before run typedoc * Install crt with only-dev for check-doc * compile crt so that the type doc could build * re-org the typedoc file location
1 parent bf5431a commit 634412f

File tree

7 files changed

+103
-33
lines changed

7 files changed

+103
-33
lines changed

documents/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>AWS-IOT-SDK-JS-V2 for Javascript</title>
6+
</head>
7+
<body>
8+
<h1>Aws IoT SDK for Javascript v2</h1>
9+
<p>While the overall interfaces for MQTT and HTTP are kept relatively in sync, the node and browser flavors of the AWS CRT have different capabilities. For this reason, we generate separate documentation for each flavor.</p>
10+
<a href="./node/index.html"><h3>Node Documentation</h3></a>
11+
<a href="./browser/index.html"><h3>Browser Documentation</h3></a>
12+
</body>
13+
</html>

documents/typedoc-browser.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"entryPoints": [
3+
"../lib/browser.ts",
4+
"../build/docs/aws-crt-nodejs/lib/browser/auth.ts",
5+
"../build/docs/aws-crt-nodejs/lib/browser/aws_iot.ts",
6+
"../build/docs/aws-crt-nodejs/lib/browser/crypto.ts",
7+
"../build/docs/aws-crt-nodejs/lib/browser/error.ts",
8+
"../build/docs/aws-crt-nodejs/lib/browser/http.ts",
9+
"../build/docs/aws-crt-nodejs/lib/browser/io.ts",
10+
"../build/docs/aws-crt-nodejs/lib/browser/mqtt.ts",
11+
"../build/docs/aws-crt-nodejs/lib/browser/ws.ts",
12+
"../build/docs/aws-crt-nodejs/lib/common/auth.ts",
13+
"../build/docs/aws-crt-nodejs/lib/common/crypto.ts",
14+
"../build/docs/aws-crt-nodejs/lib/common/event.ts",
15+
"../build/docs/aws-crt-nodejs/lib/common/http.ts",
16+
"../build/docs/aws-crt-nodejs/lib/common/io.ts",
17+
"../build/docs/aws-crt-nodejs/lib/common/mqtt.ts"
18+
],
19+
"out": "../docs/browser",
20+
"tsconfig": "../tsconfig-browser.json",
21+
"excludeExternals": true,
22+
"excludePrivate": true,
23+
"excludeInternal": true,
24+
"excludeProtected": true,
25+
"disableSources": true,
26+
"categorizeByGroup": true,
27+
"treatWarningsAsErrors" : false,
28+
"mergeModulesMergeMode": "module"
29+
}

documents/typedoc-node.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"entryPoints": [
3+
"../lib/index.ts",
4+
"../build/docs/aws-crt-nodejs/lib/native/auth.ts",
5+
"../build/docs/aws-crt-nodejs/lib/native/aws_iot.ts",
6+
"../build/docs/aws-crt-nodejs/lib/native/checksums.ts",
7+
"../build/docs/aws-crt-nodejs/lib/native/crt.ts",
8+
"../build/docs/aws-crt-nodejs/lib/native/crypto.ts",
9+
"../build/docs/aws-crt-nodejs/lib/native/error.ts",
10+
"../build/docs/aws-crt-nodejs/lib/native/http.ts",
11+
"../build/docs/aws-crt-nodejs/lib/native/io.ts",
12+
"../build/docs/aws-crt-nodejs/lib/native/mqtt.ts",
13+
"../build/docs/aws-crt-nodejs/lib/native/binding.d.ts",
14+
"../build/docs/aws-crt-nodejs/lib/common/auth.ts",
15+
"../build/docs/aws-crt-nodejs/lib/common/crypto.ts",
16+
"../build/docs/aws-crt-nodejs/lib/common/event.ts",
17+
"../build/docs/aws-crt-nodejs/lib/common/http.ts",
18+
"../build/docs/aws-crt-nodejs/lib/common/mqtt.ts",
19+
"../build/docs/aws-crt-nodejs/lib/common/resource_safety.ts"
20+
],
21+
"out": "../docs/node",
22+
"tsconfig": "../tsconfig-node.json",
23+
"excludeExternals": true,
24+
"excludePrivate": true,
25+
"excludeInternal": true,
26+
"excludeProtected": true,
27+
"disableSources": true,
28+
"categorizeByGroup": true,
29+
"treatWarningsAsErrors" : false,
30+
"mergeModulesMergeMode": "module"
31+
}
32+

make-docs.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ CRT_VERSION=`npm view aws-crt version`
1515
pushd build/docs/aws-crt-nodejs
1616
git fetch
1717
git checkout "v$CRT_VERSION"
18+
# typedoc need source to be compiled to generate the docs. Pull and install the crt dependency to make sure the lib compiled.
19+
git submodule update --init --recursive
20+
npm install .
1821
popd
1922

2023
# build docs
21-
npx typedoc --options typedoc.json
24+
npx typedoc --options documents/typedoc-node.json
25+
npx typedoc --options documents/typedoc-browser.json
26+
cp documents/index.html docs/index.html

tsconfig-browser.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"moduleResolution": "node",
5+
"lib": [
6+
"es5",
7+
"dom"
8+
],
9+
"allowSyntheticDefaultImports": true
10+
},
11+
"include": [
12+
"lib/browser.ts",
13+
"build/docs/aws-crt-nodejs/lib/browser.ts",
14+
"build/docs/aws-crt-nodejs/lib/common/*.ts",
15+
"build/docs/aws-crt-nodejs/lib/browser/*.ts"
16+
],
17+
"exclude": [
18+
"node_modules",
19+
"samples",
20+
"**/*.spec.ts",
21+
"build/docs/aws-crt-nodejs/lib/browser/polyfills.ts"
22+
]
23+
}
File renamed without changes.

typedoc.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)