Skip to content

Commit

Permalink
Added fern docs (#76)
Browse files Browse the repository at this point in the history
* adding openapi generation

* added optional responses

* added path params

* added request body

* added full openapi file

* fixed crud bug

* fixed small bugs

* added generate-docs script

* added parameter example

* create docs from handler

* improved parse openapi interface

* removed unused

* added endpoint metadata

* added current user handler

* migrated old docs to fern

* 🌿 api set-up (#75)

Co-authored-by: Catherine Deskur <chdeskur@gmail.com>

* added sdk docs

* updated tabs

* improved styling

* added header links

* added tags to docs

* added focus to docs

* added focus to team docs

* improved docs wording

* added discord link

* updated generate-keys docs

* fixed merge error

* added yaml package

* added github actions

* fixed doc gen bug

* added docs lint check

* added doc watch changes

* updated github actions

* fixed action file

* updated publish docs workflow

* added overview page

* fixed action bug

---------

Co-authored-by: fern <126544928+fern-bot@users.noreply.github.com>
Co-authored-by: Catherine Deskur <chdeskur@gmail.com>
  • Loading branch information
3 people authored Jun 15, 2024
1 parent 856cfe1 commit 019738a
Show file tree
Hide file tree
Showing 64 changed files with 1,188 additions and 635 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/e2e-api-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
Expand Down Expand Up @@ -59,7 +61,6 @@ jobs:
- name: Build stack-server
run: pnpm build:server


- name: Start stack-server in background
run: pnpm -C packages/stack-server start &
- name: Wait for stack-server to start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,22 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.1.2

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Lint
run: pnpm lint
70 changes: 70 additions & 0 deletions .github/workflows/preview-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Preview Docs

on: pull_request

jobs:
run:
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_STACK_URL: http://localhost:8101
NEXT_PUBLIC_STACK_PROJECT_ID: internal
NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY: internal-project-publishable-client-key
STACK_SECRET_SERVER_KEY: internal-project-secret-server-key
SERVER_SECRET: 23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo

EMAIL_HOST: 0.0.0.0
EMAIL_PORT: 2500
EMAIL_USERNAME: test
EMAIL_PASSWORD: none
EMAIL_SENDER: noreply@test.com

DATABASE_CONNECTION_STRING: postgres://postgres:password@localhost:5432/stackframe
DIRECT_DATABASE_CONNECTION_STRING: postgres://postgres:password@localhost:5432/stackframe

permissions: write-all

steps:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.1.2

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Generate docs
run: pnpm generate-docs

- name: Install Fern
run: npm install -g fern-api

- name: Check API is valid
run: fern check
working-directory: ./docs

- name: Generate preview URL
id: generate-docs
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
run: |
OUTPUT=$(fern generate --docs --preview 2>&1) || true
echo "$OUTPUT"
URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()')
echo "Preview URL: $URL"
echo "🌿 Preview your docs: $URL" > preview_url.txt
working-directory: ./docs

- name: Comment URL in PR
uses: thollander/actions-comment-pull-request@v2.4.3
with:
filePath: docs/preview_url.txt
58 changes: 58 additions & 0 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish Docs

on:
push:
branches:
- main

jobs:
run:
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_STACK_URL: http://localhost:8101
NEXT_PUBLIC_STACK_PROJECT_ID: internal
NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY: internal-project-publishable-client-key
STACK_SECRET_SERVER_KEY: internal-project-secret-server-key
SERVER_SECRET: 23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo

EMAIL_HOST: 0.0.0.0
EMAIL_PORT: 2500
EMAIL_USERNAME: test
EMAIL_PASSWORD: none
EMAIL_SENDER: noreply@test.com

DATABASE_CONNECTION_STRING: postgres://postgres:password@localhost:5432/stackframe
DIRECT_DATABASE_CONNECTION_STRING: postgres://postgres:password@localhost:5432/stackframe

permissions: write-all

steps:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.1.2

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Generate docs
run: pnpm generate-docs

- name: Install Fern
run: npm install -g fern-api

- name: Publish Docs
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
run: fern generate --docs --log-level debug
working-directory: ./docs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a href="https://docs.stack-auth.com">📘 Documentation</a>
| <a href="https://stack-auth.com/">☁️ Hosted Version</a>
| <a href="https://demo.stack-auth.com/">✨ Demo</a>
| <a href="https://discord.gg/pD4nyYyKrb">Discord</a>
| <a href="https://discord.stack-auth.com">Discord</a>
</h4>

## 💬 What is Stack?
Expand Down
3 changes: 0 additions & 3 deletions docs/.env

This file was deleted.

2 changes: 0 additions & 2 deletions docs/.gitignore

This file was deleted.

123 changes: 0 additions & 123 deletions docs/CHANGELOG.md

This file was deleted.

41 changes: 0 additions & 41 deletions docs/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/babel.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions docs/docs/02-customization/05-page-examples/_category_.json

This file was deleted.

Loading

0 comments on commit 019738a

Please sign in to comment.