Skip to content

Commit

Permalink
[DOCS-3194] Generate API docs for JS driver
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodewig committed Aug 9, 2024
1 parent d184a65 commit c074b2d
Show file tree
Hide file tree
Showing 9 changed files with 5,845 additions and 3,164 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ yarn-error.log*
# Build
dist/

# Docs
docs/

# Dependency directories
node_modules/

Expand All @@ -17,3 +20,6 @@ node_modules/
*#
/reports
/.vscode

# macOs
.DS_STORE
16 changes: 16 additions & 0 deletions concourse/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ resources:
aws_secret_access_key: ((prod-images-aws-secret-key))
aws_region: us-east-2

- name: fauna-js-repository-docs
type: git
icon: github
source:
uri: [email protected]:fauna/fauna-js.git
branch: gh-pages
private_key: ((github-ssh-key))

groups:
- name: pipeline
jobs:
Expand Down Expand Up @@ -152,3 +160,11 @@ jobs:
put: notify
params:
text_file: slack-message/publish

- task: publish-docs
file: main.git/concourse/tasks/publish-docs.yml
input_mapping: { fauna-js-repository: main.git }

- put: fauna-js-repository-docs
params:
repository: fauna-js-repository-updated-docs
39 changes: 39 additions & 0 deletions concourse/scripts/publish_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

set -eou

# Setup
echo 'Set up git'
apk add --no-progress --no-cache git

cd ./fauna-js-repository

PACKAGE_VERSION=$(node -p -e "require('./package.json').version")

# Generate docs
npm install
npm run docs

echo "Current docs version: $PACKAGE_VERSION"

cd ../
git clone fauna-js-repository-docs fauna-js-repository-updated-docs
cd fauna-js-repository-updated-docs

if [ -d "$PACKAGE_VERSION" ]; then
rm -rf "$PACKAGE_VERSION"
echo "Existing $PACKAGE_VERSION directory removed."
fi

cp -R "../fauna-js-repository/build/docs" "$PACKAGE_VERSION"

echo "Updating 'latest' symlink to point to $PACKAGE_VERSION"
ln -sfn "$PACKAGE_VERSION" latest

git config --global user.email "[email protected]"
git config --global user.name "Fauna, Inc"

git add -A
git commit -m "Update docs to version: $PACKAGE_VERSION"

echo "Updated docs to version: $PACKAGE_VERSION"
17 changes: 17 additions & 0 deletions concourse/tasks/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: node
tag: 15.14.0-alpine3.10

inputs:
- name: fauna-js-repository
- name: fauna-js-repository-docs

outputs:
- name: fauna-js-repository-updated-docs

run:
path: ./fauna-js-repository/concourse/scripts/publish_docs.sh
17 changes: 17 additions & 0 deletions overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Used for auto-generated reference docs -->

API reference documentation for the
[Fauna v10 JavaScript driver](https://github.com/fauna/fauna-js).

For examples and tutorials, see the [driver
README](<(https://github.com/fauna/fauna-js)>) and the [Fauna
docs](https://docs.fauna.com/fauna/current/build/drivers/js-client/).

## Important classes and methods

- [Client](classes/Client.html): Use instances of this class to send requests to Fauna.
- [query()](classes/Client.html#query): Use this method to run queries.

## All modules

For all available modules, see [Modules](Modules.html).
Loading

0 comments on commit c074b2d

Please sign in to comment.