-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Invoke typedoc to produce browsable JS API documentation (#4757)
Replaces the annotation processor previously used with a doclet implementation. This still emits a .d.ts file using Java mirror/element types for accurate type information, but now is able to traverse Javadoc trees as well, and produces corresponding typedoc tags or markdown. The typedoc tool now generates HTML for deployment to the Deephaven docs website. Additionally, this branch produces a tarball suitable for deployment as an npm module, containing only those generated types. However, this output is still untested.
- Loading branch information
Showing
9 changed files
with
273 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,57 @@ jobs: | |
remote_user: ${{ secrets.DOCS_USER }} | ||
remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }} | ||
|
||
typedoc: | ||
runs-on: ubuntu-22.04 | ||
concurrency: | ||
group: typedoc-${{ github.workflow }}-${{ github.ref }} | ||
# We don't want to cancel in-progress jobs against main because that might leave the upload in a bad state. | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup JDK 11 | ||
id: setup-java-11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
- name: Setup JDK 17 | ||
id: setup-java-17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Set JAVA_HOME | ||
run: echo "JAVA_HOME=${{ steps.setup-java-11.outputs.path }}" >> $GITHUB_ENV | ||
|
||
- name: Run typedoc on JS API | ||
uses: burrunan/gradle-cache-action@v1 | ||
with: | ||
job-id: typedoc | ||
arguments: --scan :web-client-api:types:typedoc | ||
gradle-version: wrapper | ||
- name: Upload JavaScript/TypeScript docs | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: typedoc | ||
path: 'web/client-api/types/build/documentation/' | ||
- name: Deploy JavaScript/TypeScript docs | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: burnett01/[email protected] | ||
with: | ||
switches: -avzr --delete | ||
path: web/client-api/docs/build/documentation/ | ||
remote_path: deephaven-core/client-api/javascript/ | ||
remote_host: ${{ secrets.DOCS_HOST }} | ||
remote_port: ${{ secrets.DOCS_PORT }} | ||
remote_user: ${{ secrets.DOCS_USER }} | ||
remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }} | ||
|
||
pydoc: | ||
runs-on: ubuntu-22.04 | ||
concurrency: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
plugins { | ||
id 'com.bmuschko.docker-remote-api' | ||
id 'io.deephaven.project.register' | ||
} | ||
|
||
configurations { | ||
dts | ||
} | ||
dependencies { | ||
dts project(path: ':web-client-api', configuration: 'dts') | ||
} | ||
|
||
Docker.registerDockerTask(project, 'typedoc') { | ||
copyIn { | ||
from(configurations.dts) { | ||
into 'dist' | ||
} | ||
from 'tsconfig.json' | ||
from 'package.json' | ||
from 'package-lock.json' | ||
|
||
from('src/main/docker') { | ||
include 'theme.css' | ||
} | ||
} | ||
dockerfile { | ||
// share the common base image to keep it simple | ||
from 'deephaven/node:local-build' | ||
|
||
copyFile('.', '/project') | ||
|
||
runCommand('''set -eux; \\ | ||
cd /project/; \\ | ||
mv dist/types.d.ts dist/index.d.ts; \\ | ||
npm ci; \\ | ||
npm pack; \\ | ||
mkdir /out; \\ | ||
mv deephaven-jsapi-types*.tgz /out/; \\ | ||
node_modules/.bin/typedoc dist/index.d.ts \\ | ||
--out /out/documentation \\ | ||
--skipErrorChecking \\ | ||
--hideGenerator \\ | ||
--disableSources \\ | ||
--customCss theme.css; \\ | ||
''') | ||
} | ||
parentContainers = [ Docker.registryTask(project, 'node') ] // deephaven/node | ||
containerOutPath = '/out' | ||
copyOut { | ||
into "$buildDir/" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.deephaven.project.ProjectType=BASIC |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "@deephaven/jsapi-types", | ||
"version": "1.0.0-dev1", | ||
"description": "Deephaven JSAPI Types", | ||
"author": "Deephaven Data Labs LLC", | ||
"license": "Apache-2.0", | ||
"type": "module", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/deephaven/deephaven-core.git", | ||
"directory": "web/client-api/types" | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"devDependencies": { | ||
"typedoc": "^0.24.8", | ||
"typescript": "^5.1.6" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"sideEffects": false, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
:root { | ||
--dark-color-background: #040427; | ||
--dark-color-background-secondary: #0d1b37; | ||
--dark-color-background-warning: #fffbef; | ||
--dark-color-warning-text: #463b19; | ||
--dark-color-accent: #24405a; | ||
--dark-color-active-menu-item: #2f546c; | ||
--dark-color-text: #f0f9fb; | ||
--dark-color-text-aside: #d3d3d3; | ||
--dark-color-link: #65c6da; | ||
--dark-color-ts-project: #b7a9f6; | ||
--dark-color-ts-enum: #f4d93e; | ||
--dark-color-ts-variable: #b2e3ed; | ||
--dark-color-ts-function: #d5cdfa; | ||
--dark-color-ts-class: #93d7e5; | ||
--dark-color-ts-interface: #afd685; | ||
--dark-color-ts-type-alias: #f27596; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"files": ["dist/index.d.ts"], | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["es5","es2015", "DOM"] | ||
} | ||
} |