Skip to content

Commit

Permalink
Merge pull request #83 from polywrap/pileks/feat/typedoc
Browse files Browse the repository at this point in the history
Add reference documentation via Github Pages
  • Loading branch information
dOrgJelli authored Oct 31, 2023
2 parents 66c1d04 + 8adb627 commit ff66e0a
Show file tree
Hide file tree
Showing 41 changed files with 814 additions and 550 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/cd-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Deploy Documentation

on:
push:
branches:
main

jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: (yarn install --nonInteractive --frozen-lockfile --prefer-offline || yarn install --nonInteractive --frozen-lockfile --prefer-offline)

- name: Build
run: yarn build

- name: Generate reference
run: yarn build:reference

- name: Deploy documentation to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages-reference
folder: reference
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ polywrap.deployment.txt
**/__pycache__/
**/dist/
poetry.lock
examples/yarn.lock
examples/yarn.lock
reference
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build:bundles": "lerna run build --scope @polywrap/*-config-bundle-js",
"build:client": "lerna run build --scope @polywrap/core-client-js --scope @polywrap/client-js --scope @polywrap/client-config-builder-js",
"build:docs": "lerna run build:docs",
"build:reference": "npx typedoc",
"lint": "lerna run lint",
"lint:fix": "lerna run lint -- --fix",
"lint:ci": "yarn lint",
Expand All @@ -44,7 +45,8 @@
"graphql": "15.5.0",
"lerna": "4.0.0",
"prettier": "2.2.1",
"rimraf": "3.0.2",
"ts-node": "10.9.1",
"rimraf": "3.0.2"
"typedoc": "^0.25.1"
}
}
}
2 changes: 1 addition & 1 deletion packages/asyncify/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"lib": [
"es2020",
Expand Down
4 changes: 4 additions & 0 deletions packages/asyncify/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"lib": [
"es2020",
Expand Down
4 changes: 4 additions & 0 deletions packages/client/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/config-builder/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"include": [
"./src/**/*.ts",
"./examples/**/*.ts"
Expand Down
4 changes: 4 additions & 0 deletions packages/config-builder/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/config-bundle/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/config-bundle/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/config-bundles/sys/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig",
"extends": "../../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/config-bundles/sys/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/config-bundles/web3/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig",
"extends": "../../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/config-bundles/web3/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/core-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"lib": [
"es2020",
Expand Down
4 changes: 4 additions & 0 deletions packages/core-client/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/core/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/manifests/wrap/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig",
"extends": "../../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/msgpack/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"lib": [
"es2020",
Expand Down
4 changes: 4 additions & 0 deletions packages/msgpack/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/result/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/result/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/test-cases/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"lib": [
"es2020",
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"outDir": "build",
"typeRoots": [
Expand Down
4 changes: 4 additions & 0 deletions packages/tracing/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
1 change: 1 addition & 0 deletions packages/uri-resolver-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@polywrap/plugin-js": "0.12.2",
"@polywrap/test-cases": "0.12.2",
"@types/jest": "29.5.0",
"@types/copyfiles": "2.4.1",
"base64-to-uint8array": "1.0.0",
"copyfiles": "2.4.1",
"doc-snippets": "~1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/uri-resolver-extensions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/uri-resolver-extensions/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/uri-resolvers/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/uri-resolvers/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/wasm/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig",
"extends": "../../tsconfig.base",
"compilerOptions": {
"outDir": "build"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/wasm/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["./src/index.ts"],
"tsconfig": "./tsconfig.json"
}
8 changes: 3 additions & 5 deletions tsconfig.json → tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"experimentalDecorators": true,
"moduleResolution": "node",
"declaration": true,
"declarationMap": true,
"preserveSymlinks": true,
"preserveWatchOutput": true,
"pretty": false,
Expand All @@ -22,9 +23,6 @@
"sourceMap": true,
"target": "es5",
"resolveJsonModule": true,
"strictNullChecks": true
},
"include": [
"./src/**/*"
],
"strictNullChecks": true,
}
}
49 changes: 49 additions & 0 deletions tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"references": [
{
"path": "./packages/asyncify"
},
{
"path": "./packages/client"
},
{
"path": "./packages/config-builder"
},
{
"path": "./packages/config-bundle"
},
{
"path": "./packages/config-bundles/sys"
},
{
"path": "./packages/config-bundles/web3"
},
{
"path": "./packages/core"
},
{
"path": "./packages/core-client"
},
{
"path": "./packages/msgpack"
},
{
"path": "./packages/plugin"
},
{
"path": "./packages/result"
},
{
"path": "./packages/tracing"
},
{
"path": "./packages/uri-resolver-extensions"
},
{
"path": "./packages/uri-resolvers"
},
{
"path": "./packages/wasm"
}
]
}
4 changes: 4 additions & 0 deletions typedoc.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://typedoc.org/schema.json",
"includeVersion": true,
}
12 changes: 12 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entryPoints": ["./packages/*", "./packages/config-bundles/*"],
"exclude": ["./packages/test-cases"],
"name": "Polywrap Javascript Client",
"entryPointStrategy": "packages",
"includeVersion": true,
"tsconfig": "./tsconfig.docs.json",
"out": "./reference"

// Potentially useful for debugging
// "logLevel": "Verbose"
}
Loading

0 comments on commit ff66e0a

Please sign in to comment.