Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: docs.page 2024 refresh #359

Merged
merged 165 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
3c2ded7
Rework (#355)
Ehesp Jul 17, 2024
9679e42
add vercel preset
Ehesp Jul 17, 2024
7bfc38e
update output dir
Ehesp Jul 17, 2024
e12deee
-
Ehesp Jul 17, 2024
50af9fa
-
Ehesp Jul 17, 2024
e21c7f5
-
Ehesp Jul 17, 2024
fbaed56
-
Ehesp Jul 17, 2024
6e79b45
update lockfile
Ehesp Jul 17, 2024
28c0f90
remove api password
Ehesp Jul 17, 2024
4f102f1
disable server caching on preview
Ehesp Jul 17, 2024
0d82c73
prefix domains with https
Ehesp Jul 17, 2024
efcd32d
dont use domain on staging
Ehesp Jul 17, 2024
3d76694
update env check
Ehesp Jul 17, 2024
1681561
update response.json
Ehesp Jul 17, 2024
23f99c9
move headers logic
Ehesp Jul 17, 2024
b11afe6
add globals for vercel
Ehesp Jul 17, 2024
d200d2f
-
Ehesp Jul 17, 2024
1909ec8
use native fetch
Ehesp Jul 17, 2024
e4e05c3
redirect to original request origin
Ehesp Jul 17, 2024
71dc8e8
api: break out schema models
Ehesp Jul 17, 2024
114bcd9
fix sidebar schema
Ehesp Jul 17, 2024
11b11bc
fix: zoomable background colour
Ehesp Jul 17, 2024
d611d49
fix: edit url
Ehesp Jul 17, 2024
f881958
fix: sidebar conversion
Ehesp Jul 17, 2024
88fef42
feat: add nprogress
Ehesp Jul 17, 2024
9626c42
fix: sidebar spacing
Ehesp Jul 17, 2024
7482b59
fix: made InvalidComponent more prominent
Ehesp Jul 17, 2024
4cf6484
fix: handle social preview
Ehesp Jul 17, 2024
b8305d9
fix: base 64 on env
Ehesp Jul 17, 2024
5800e22
fix: skip scripts when not in prod
Ehesp Jul 17, 2024
a5c39fe
feat: add Steps component
Ehesp Jul 19, 2024
7a9458f
fix: Tab re-render idea
Ehesp Jul 19, 2024
e72b11c
docs: add icon docs
Ehesp Jul 19, 2024
fad8985
fix env access on client
Ehesp Jul 19, 2024
55185aa
send build hash to api
Ehesp Jul 19, 2024
4ee74eb
fix hydration mismatch error
Ehesp Jul 19, 2024
a7b74f6
fix invalid/empty hex code
Ehesp Jul 19, 2024
1e58cb6
css overflow fixes
Ehesp Jul 19, 2024
9aad2ab
attempt to fix rewrite handling
Ehesp Jul 22, 2024
5264dbf
add cards component
Ehesp Jul 22, 2024
6edf63b
memo mdx content
Ehesp Jul 23, 2024
64dc52a
open sans + jetbrains mono
Ehesp Jul 23, 2024
57a31ae
send duplex option
Ehesp Jul 24, 2024
43001cc
remove native fetch
Ehesp Jul 25, 2024
814d02c
Merge branch 'next' of https://github.com/invertase/docs.page into next
Ehesp Jul 25, 2024
abff4b2
disable single fetch
Ehesp Jul 25, 2024
5fda8a7
require config file
Ehesp Jul 25, 2024
50a360f
throw specific preview error on config not found
Ehesp Jul 25, 2024
5a4e8a5
add Property component
Ehesp Jul 25, 2024
c213adf
update Property docs
Ehesp Jul 26, 2024
95ddcb6
update component docs
Ehesp Jul 29, 2024
159937d
add check cli
Ehesp Jul 29, 2024
fc198f6
update check output
Ehesp Jul 29, 2024
b632c84
cleanup packages
Ehesp Jul 31, 2024
7f4f843
cleanup cli init command
Ehesp Jul 31, 2024
af469b5
update contributing guides
Ehesp Jul 31, 2024
3ef7e46
add code group sync
Ehesp Jul 31, 2024
8a1f078
update docs
Ehesp Jul 31, 2024
24423e5
formatting
Ehesp Jul 31, 2024
bd9f9d3
lock react version
Ehesp Jul 31, 2024
37a08f6
test
Ehesp Jul 31, 2024
33b5cb8
-
Ehesp Jul 31, 2024
52fe3c8
normalize paths
Ehesp Jul 31, 2024
fa4dc7f
update configuration docs
Ehesp Aug 1, 2024
5c127fb
update docs
Ehesp Aug 1, 2024
2fc43cc
-
Ehesp Aug 1, 2024
d449570
-
Ehesp Aug 2, 2024
922b579
-
Ehesp Aug 2, 2024
6e8425b
Merge branch 'next' of https://github.com/invertase/docs.page into next
Ehesp Aug 2, 2024
57d5550
update event handler
Ehesp Aug 2, 2024
37f3306
stringify github api body
Ehesp Aug 2, 2024
50874ab
update octokit
Ehesp Aug 5, 2024
17e6c37
fix: github bot comment
Ehesp Aug 5, 2024
923d39c
add webhook events
Ehesp Aug 6, 2024
3430581
update cli build flow
Ehesp Aug 6, 2024
940078e
update getting-started
Ehesp Aug 6, 2024
4f8b26b
update tabs api
Ehesp Aug 6, 2024
90abe2e
update docs
Ehesp Aug 6, 2024
6c6b72e
-
Ehesp Aug 6, 2024
98009bb
add cli docs
Ehesp Aug 6, 2024
5797ba3
add checks toolbar
Ehesp Aug 6, 2024
c7628a0
trap request error
Ehesp Aug 6, 2024
69c3cdd
-
Ehesp Aug 6, 2024
a690f87
wip check run
Ehesp Aug 7, 2024
b04633d
add check run flow
Ehesp Aug 8, 2024
1eb25f2
wip homepage
Ehesp Aug 8, 2024
ea566f8
lint
Ehesp Aug 8, 2024
dd3c45d
wip homepage
Ehesp Aug 8, 2024
44f21c8
-
Ehesp Aug 8, 2024
81149b2
-
Ehesp Aug 9, 2024
943fdb4
fix tabs -> spaces
Ehesp Aug 9, 2024
fc2e8e6
-
Ehesp Aug 9, 2024
1a72d22
-
Ehesp Aug 9, 2024
626ed10
-
Ehesp Aug 9, 2024
9606b48
-
Ehesp Aug 9, 2024
182dc54
-
Ehesp Aug 12, 2024
85e19aa
homepage updates
Ehesp Aug 12, 2024
705667c
update theme
Ehesp Aug 12, 2024
c784069
-
Ehesp Aug 12, 2024
e451c04
-
Ehesp Aug 12, 2024
7245fd7
update theme
Ehesp Aug 12, 2024
6f0406e
-
Ehesp Aug 12, 2024
97665b8
-
Ehesp Aug 13, 2024
9688838
feat: code diff/higjlighting/focus
Ehesp Aug 13, 2024
063b67f
responsive
Ehesp Aug 13, 2024
a9a435e
wip preview page
Ehesp Aug 13, 2024
77a2f2f
-
Ehesp Aug 13, 2024
54bc73d
-
Ehesp Aug 13, 2024
3e3629f
update dockerfile
Ehesp Aug 14, 2024
7c38dc1
-
Ehesp Aug 14, 2024
2795804
update lock
Ehesp Aug 14, 2024
8f4a452
ci
Ehesp Aug 14, 2024
a28d4af
update CLI readme
Ehesp Aug 14, 2024
19c5fdf
-
Ehesp Aug 14, 2024
c5a6994
update keywords
Ehesp Aug 14, 2024
373fef8
update cli
Ehesp Aug 14, 2024
88fc80e
publish as esm only
Ehesp Aug 14, 2024
6f4e0c8
remove prebuild command
Ehesp Aug 14, 2024
8f56307
cli 1.0.4
Ehesp Aug 14, 2024
309fab3
add twoslash
Ehesp Aug 14, 2024
c116635
support image theme
Ehesp Aug 14, 2024
9b08113
bump bun version
Ehesp Aug 14, 2024
a7129aa
fix port env
Ehesp Aug 14, 2024
f2b51d6
wip logo
Ehesp Aug 15, 2024
2afbff3
wip homepage
Ehesp Aug 15, 2024
fe6a985
swap favicon for new theme
Ehesp Aug 20, 2024
f41d0b5
add social metadata
Ehesp Aug 20, 2024
64c55c8
responsive fixes
Ehesp Aug 20, 2024
644c6f1
formatting
Ehesp Aug 20, 2024
365d59c
fix social media image font
Ehesp Aug 20, 2024
7c5b643
tweaks
Ehesp Aug 21, 2024
eedd344
update preview page
Ehesp Aug 23, 2024
d879f89
get-started / preview
Ehesp Aug 23, 2024
c60c211
wip
Ehesp Aug 27, 2024
1e5ec8a
add layout outlet
Ehesp Aug 27, 2024
a41095d
formatting
Ehesp Aug 27, 2024
3ea39dd
handle custom domains rewrite
Ehesp Aug 27, 2024
5431ff4
handle error envs
Ehesp Aug 27, 2024
8ece824
improve preview workflow
Ehesp Aug 28, 2024
5207d2c
add homepage images
Ehesp Aug 28, 2024
ff214dc
cache bust
Ehesp Aug 28, 2024
d8d09bb
fix step blowout
Ehesp Aug 28, 2024
98f535c
update client logic
Ehesp Aug 28, 2024
ab3f030
-
Ehesp Aug 28, 2024
d94a922
update platform images
Ehesp Aug 28, 2024
017ca85
-
Ehesp Aug 28, 2024
1d6292c
align image
Ehesp Aug 28, 2024
d302e03
-
Ehesp Aug 28, 2024
5321167
-
Ehesp Aug 28, 2024
ca4677a
-
Ehesp Aug 28, 2024
7ea1cb1
-
Ehesp Aug 28, 2024
8a21c71
-
Ehesp Aug 28, 2024
9b468f8
test
Ehesp Aug 28, 2024
963da03
-
Ehesp Aug 28, 2024
0271094
responsive fixes
Ehesp Aug 28, 2024
d2c931e
responsive tweaks
Ehesp Aug 28, 2024
5c6c304
update docs
Ehesp Aug 28, 2024
db8a19a
attempt to fix domains
Ehesp Aug 28, 2024
ecff69d
handle bad routing scenario
Ehesp Aug 28, 2024
e17fd40
-
Ehesp Aug 28, 2024
b9b1a19
handle vanity urls
Ehesp Aug 29, 2024
78fb8de
-
Ehesp Aug 29, 2024
09b6286
update get-started images
Ehesp Aug 29, 2024
4f79704
update demo video
Ehesp Aug 29, 2024
929a593
Merge branch 'main' into next
Salakar Aug 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

40 changes: 0 additions & 40 deletions .eslintrc

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Code quality

on:
pull_request:

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci .
22 changes: 0 additions & 22 deletions .github/workflows/website.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# We ignore this since we're using Bun for workspace management, and some environments
# will detect this file and use npm instead of bun.
package-lock.json

# dependencies
node_modules
/.pnp
Expand Down
8 changes: 0 additions & 8 deletions .prettierignore

This file was deleted.

10 changes: 0 additions & 10 deletions .prettierrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Contributing

This repository uses [Bun](https://bun.sh/) for workspace and dependency management. To get started, run the following commands:

```bash
bun install
```

The repository is structured as follows:

- `api`: The API server which is served via `https://api.docs.page`. This is an express application which handles tasks such as fetching content from GitHub and markdown parsing.
- `og`: A Next.js application which serves the Open Graph images for documentation pages.
- `website`: A Remix application which serves the main `https://docs.page` website, and the documentation rendering for each repository.
- `packages/cli`: A CLI for running various commands and scripts for initialization, checking etc. Used locally and on CI environments.

## Running docs.page

Generally, you'll want to interface with the website and api. To run these concurrently, you can use the following command:

```bash
bun dev
```

This will start the website on `http://localhost:5173` and the api on `http://localhost:8080`.

> The API requires a `GITHUB_APP_ID` and `GITHUB_APP_PRIVATE_KEY` to be set in your environment. These are used to authenticate with the GitHub API. You can create a GitHub App in your GitHub account settings.
9 changes: 5 additions & 4 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM oven/bun:1.0.29
FROM oven/bun:1.1.22

ARG BUILD_SHA=default_value
ENV __BUILD_SHA=$BUILD_SHA

WORKDIR /opt/app
COPY . /opt/app
RUN cd /opt/app && bun install --frozen-lockfile --production
COPY . .
RUN bun install --frozen-lockfile --production

WORKDIR /opt/app/api

WORKDIR /opt/app
CMD ["bun","run","start"]
Binary file removed api/bun.lockb
Binary file not shown.
18 changes: 12 additions & 6 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
"license": "MIT",
"dependencies": {
"@code-hike/mdx": "0.7.2",
"@docs.page/cli": "workspace:*",
"@mdx-js/mdx": "2.2.1",
"@octokit/graphql": "5.0.0",
"@types/cors": "^2.8.12",
"@octokit/webhooks": "^13.2.7",
"@shikijs/transformers": "1.12.1",
"@shikijs/twoslash": "^1.12.1",
"@types/express": "^4.17.13",
"@types/morgan": "^1.9.3",
"@types/node": "^18.0.0",
"a2a": "^0.2.0",
"camelcase": "7.0.0",
"cors": "2.8.5",
"dotenv": "16.0.1",
"esbuild": "0.14.47",
"express": "4.18.1",
Expand All @@ -26,21 +28,23 @@
"hast-util-parse-selector": "3.1.0",
"is-badge": "^2.1.0",
"js-yaml": "4.1.0",
"jszip": "^3.10.1",
"lodash.get": "^4.4.2",
"mdx-bundler": "9.0.1",
"morgan": "1.10.0",
"node-fetch": "3.2.6",
"pm2": "5.3.0",
"probot": "12.2.8",
"octokit": "^4.0.2",
"rehype-accessible-emojis": "0.3.2",
"rehype-katex": "6.0.2",
"rehype-slug": "5.0.1",
"remark-comment": "1.0.0",
"remark-gfm": "3.0.1",
"remark-math": "5.1.1",
"remark-parse": "10.0.1",
"shiki": "1.1.7",
"shiki": "1.12.1",
"unist-util-visit": "4.1.0",
"zod": "3.22.4",
"zod-to-json-schema": "^3.23.1",
"zod-validation-error": "0.2.2"
},
"scripts": {
Expand All @@ -49,9 +53,11 @@
},
"devDependencies": {
"@octokit/webhooks-types": "^6.2.4",
"@types/bun": "^1.1.6",
"@types/js-yaml": "^4.0.5",
"@types/lodash.get": "^4.4.9",
"rollup": "3.9.1",
"ts-node": "^10.8.1",
"typescript": "4.7.4"
"typescript": "5.5.3"
}
}
35 changes: 16 additions & 19 deletions api/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
import express, { Router, text } from 'express';
import morgan from 'morgan';
import cors from 'cors';
import { config } from 'dotenv';
import express, { Router, text } from "express";
import morgan from "morgan";

import bundle from './routes/bundle';
import preview from './routes/preview';
import mdx from './routes/mdx';
import probot from './probot';
import { notFound } from './res';
import { notFound } from "./res";
import bundle from "./routes/bundle";
import preview from "./routes/preview";
import schema from "./routes/schema";
import githubWebhook from "./routes/webhooks.github";

config();
import { ENV } from "./env";

const PORT = process.env.PORT || 8080;
const PORT = ENV.PORT;
const app = express();
app.use(text());
app.use(cors());
app.use(morgan('dev'));
app.use(morgan("dev"));
app.use(express.json());
app.use(
express.urlencoded({
extended: true,
}),
);
app.use(probot);

const router = Router();
router.get('/status', (_, res) => res.status(200).send('OK'));
router.post('/preview', preview);
router.get('/bundle', bundle);
router.post('/mdx', mdx);
router.all('*', (_, res) => notFound(res));
router.get("/status", (_, res) => res.status(200).send("OK"));
router.get("/schema.json", schema);
router.post("/preview", preview);
router.get("/bundle", bundle);
router.post("/webhooks/github", githubWebhook);
router.all("*", (_, res) => notFound(res));
app.use(router);

app.listen(PORT, () => {
Expand Down
23 changes: 23 additions & 0 deletions api/src/bundler/error.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export class BundlerError extends Error {
code: number;
name: string;
source?: string;

constructor({
code,
name,
message,
source,
}: {
code: number;
name: string;
message: string;
source?: string;
}) {
super(message);
this.code = code;
this.name = name;
this.message = message;
this.source = source;
}
}
Loading
Loading