Skip to content

Commit

Permalink
refactor: switch to json based docs
Browse files Browse the repository at this point in the history
- feat: start setting up the plugin for parsing
- feat: start parsing classes
- feat: update framework json
- fix: fixed rendering custom files with css
- chore: update framework json to exclude externals
- feat: setup parsing sapphire classes and do a lot of link fixing
- refactor: switch to sapphire result
- fix: remove replaceall for Node 14 compat
- fix: actually remove replaceAll
- fix: fixed css extraction regex
- I thought I did this already
- fix: fixed broken link on welcome page
- chore: temporarily disable reporting broken links
- feat: much stuff
- change `classes` to `class` to match DJS
- add `typedef` and `namespace` linking
- fix linking of non-generic types
- update guide urls to match `class` change
- chore: bump deps
- chore: cleanup types
- feat: add variant to typedefs
- build: make it easier to debug
- fix: partially fix link extraction
- feat(docgen): add renderTypedef()
   - Moved parseSee() from /lib/renderer/renderClass.ts to /lib/renderer/utils.ts
   - Add /lib/renderer/renderTypedef.ts
     Which adds basic functionality in the website with things like title, description and extendedDescription
- chore: sort ts interfaces in docgen output
- chore: update doc types
- refactor: completely refactor how links are resolved
- fix: fixed links for `{@link` tags and propegate change to mdn and djs
- fix: use `replace` instead of `replaceAll`
- feat(docusaurus-discordjs-docgen): add functionality for enum and interface
- style(docusaurus-discordjs-docgen): use Array#flat() for typedef
- feat(docusaurus-discordjs-docgen): add constructor table functionality for classes
- feat(docusaurus-discordjs-docgen): align table content to center
- feat(docusaurus-discordjs-docgen): remove description column if all falsy
- feat(docusaurus-discordjs-docgen): add properties functionality for classes
- ci: add automatic vercel deploys workflow
- chore(docusaurus-typedoc-json-parser): initial commit
- chore(docusaurus-typedoc-json-parser): add doc fetching
- chore(docusaurus-typedoc-json-parser): add sidebar rendering
- fix(deps): update all non-major dependencies
- fix(deps): update dependency typedoc-json-parser to ^5.2.0
- feat(docusaurus-typedoc-json-parser): add basic renderers
- style(docusaurus-typedoc-json-parser): curly brackets and spacing
- style(docusaurus-typedoc-json-parser): template literals
- feat(docusaurus-typedoc-json-parser): add class extends and implements
- feat(docusaurus-typedoc-json-parser): add link parsing for the local project
- chore(docusaurus-typedoc-json-parser): add `start` script to bypass debugger
- feat(docusaurus-typedoc-json-parser): add comment info for classes
- chore: update dev deps
- chore: regen and dedupe lockfile
- fix(docusaurus-typedoc-json-parser): absorb breaking changes and add versioning
- refactor: switch to using typedoc-json-parser plugin
- chore: add `update` script
- fix(deps): update dependency typedoc-json-parser to ^6.0.2
- fix(docusaurus-typedoc-json-parser): proper category yamls
- feat(docusaurus-typedoc-json-parser): first steps to proper type linking
- refactor(docusaurus-typedoc-json-parser): switch from constant to variable
- feat(docusaurus-typedoc-json-parser): render classes
- ci: use tags for actions
- chore: cleanup
- fix(typedoc-parser): fixed no auth requests
- refactor: depluginize the plugin
- chore: fix typecheck
- chore: update to yarn 3.2.4
- chore: remove unnecessary package script
- feat(json-parser): render enums
- chore(json-parser): remove useless script
- feat(json-parser): render functions
- feat(json-parser): add accessibility and static modifiers for class methods
- feat(json-parser): more steps towards proper reference linking
- chore(deps): update dependency typedoc-json-parser to ^7.0.0
- fix(deps): update dependency typedoc-json-parser to ^7.0.1
- feat(json-parser): even more steps to proper reference linking
- chore: update deps
- feat: add ReadOnlyPill code
- feat: add code for other pills
- fix: flex wrap items
- chore: update readme banner
- feat(json-parser): progress!
- refactor(json-parser): rendered file structure
- feat(json-parser): include latest and next version
- feat(json-parser): include all major versions
- fix(json-parser): update `typedoc-json-parser` to ^8.0.0
- feat(json-parser): add functionality to find types in neighbour packages
- chore(scripts): add update
- chore: update dependencies
- build: fix tsconfig for json-parser
  • Loading branch information
favna committed Oct 9, 2023
1 parent fb94e27 commit b8be493
Show file tree
Hide file tree
Showing 58 changed files with 17,594 additions and 19,598 deletions.
6 changes: 1 addition & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Node modules
node_modules/

# Submodules
projects/

# Generated data
docs/Documentation/
.docusaurus/
json-parser/dist/

src/index.d.ts

docs/Guide/code/
16 changes: 16 additions & 0 deletions .github/workflows/automatic-vercel-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Automatic Vercel Deploys

on:
# TODO: Enable pre-merge
# schedule:
# - cron: '30 3 * * *'
workflow_dispatch:

jobs:
AutomaticVercelDeploy:
runs-on: ubuntu-latest
steps:
- name: Trigger Vercel Deploy
run: curl -X POST ${VERCEL_DEPLOY_HOOK_URL}
env:
VERCEL_DEPLOY_HOOK_URL: ${{ secrets.VERCEL_DEPLOY_HOOK_URL }}
48 changes: 0 additions & 48 deletions .github/workflows/update-submodules.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ build/
.docusaurus/
.cache-loader/
docs/Documentation/
tsconfig.tsbuildinfo

# misc
.DS_Store
Expand Down
24 changes: 0 additions & 24 deletions .gitmodules

This file was deleted.

4 changes: 1 addition & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Node modules
node_modules/

# Submodules
projects/

# Generated data
docs/Documentation/
.docusaurus/
build/
json-parser/dist/
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"runtimeArgs": ["run-script", "debug"],
"name": "Debug Docgen",
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**", "node_modules/tslib/**"],
"internalConsoleOptions": "openOnSessionStart",
"cwd": "${workspaceFolder}/json-parser",
"env": {
"NODE_ENV": "development"
},
"console": "internalConsole",
"outputCapture": "std",
"outFiles": ["${workspaceFolder}/json-parser/dist/**/*.js"]
}
]
}
222 changes: 111 additions & 111 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

262 changes: 131 additions & 131 deletions .yarn/releases/yarn-3.6.3.cjs → .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
spec: '@yarnpkg/plugin-interactive-tools'
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"
spec: '@yarnpkg/plugin-typescript'
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
spec: '@yarnpkg/plugin-workspace-tools'

yarnPath: .yarn/releases/yarn-3.6.3.cjs
yarnPath: .yarn/releases/yarn-3.6.4.cjs
112 changes: 5 additions & 107 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ const BaseUrl = 'https://sapphirejs.dev';
const Email = '[email protected]';
const Title = 'Sapphire Framework';

/** @type {import('@docusaurus/types').Config} */
/** @type {import('@docusaurus/types').DocusaurusConfig} */
const config = {
title: 'Sapphire',
url: BaseUrl,
baseUrl: '/',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
// TODO: Re-enable after adding all JSON files. See temporary-errors-log-of-broken-links.md
onBrokenLinks: 'ignore',
// TODO: Re-enable after adding all JSON files. See temporary-errors-log-of-broken-links.md
onBrokenMarkdownLinks: 'ignore',
onDuplicateRoutes: 'warn',
favicon: 'favicon.ico',
tagline: Description,
Expand Down Expand Up @@ -47,110 +49,6 @@ const config = {
}
]
}
],
[
'docusaurus-plugin-typedoc',
{
id: 'framework',
entryPoints: ['./projects/framework/src/index.ts'],
tsconfig: './projects/framework/src/tsconfig.json',
readme: 'none',
out: 'Documentation/api-framework',
plugin: ['typedoc-plugin-mdn-links', 'typedoc-plugin-djs-links'],
sidebar: {
categoryLabel: '@sapphire/framework',
position: 0,
fullNames: true
}
}
],
[
'docusaurus-plugin-typedoc',
{
id: 'Pieces',
entryPoints: ['./projects/pieces/src/index.ts'],
tsconfig: './projects/pieces/src/tsconfig.json',
readme: 'none',
out: 'Documentation/api-pieces',
plugin: ['typedoc-plugin-mdn-links'],
sidebar: {
categoryLabel: '@sapphire/pieces',
position: 1,
fullNames: true
}
}
],
[
'docusaurus-plugin-typedoc',
{
id: 'Utilities',
entryPointStrategy: 'packages',
entryPoints: ['./projects/utilities/packages/*'],
exclude: [
'./projects/utilities/packages/eslint-config',
'./projects/utilities/packages/eslint-plugin-result',
'./projects/utilities/packages/prettier-config',
'./projects/utilities/packages/ts-config'
],
tsconfig: './tsconfig.typedoc.json',
readme: 'none',
out: 'Documentation/api-utilities',
plugin: ['typedoc-plugin-mdn-links', 'typedoc-plugin-djs-links'],
sidebar: {
categoryLabel: 'Sapphire Utilities',
position: 2
}
}
],
[
'docusaurus-plugin-typedoc',
{
id: 'Plugins',
entryPointStrategy: 'packages',
entryPoints: ['./projects/plugins/packages/*'],
tsconfig: './tsconfig.typedoc.json',
readme: 'none',
out: 'Documentation/api-plugins',
excludeExternals: true,
externalPattern: ['node_modules/@types/**'],
plugin: ['typedoc-plugin-mdn-links', 'typedoc-plugin-djs-links'],
sidebar: {
categoryLabel: 'Sapphire Plugins',
position: 3
}
}
],
[
'docusaurus-plugin-typedoc',
{
id: 'Type',
entryPoints: ['./projects/type/src/index.ts'],
tsconfig: './projects/type/src/tsconfig.json',
readme: './projects/type/README.md',
out: 'Documentation/api-type',
plugin: ['typedoc-plugin-mdn-links'],
sidebar: {
categoryLabel: '@sapphire/type',
position: 4,
fullNames: true
}
}
],
[
'docusaurus-plugin-typedoc',
{
id: 'Shapeshift',
entryPoints: ['./projects/shapeshift/src/index.ts'],
tsconfig: './projects/shapeshift/src/tsconfig.json',
readme: './projects/shapeshift/README.md',
out: 'Documentation/api-shapeshift',
plugin: ['typedoc-plugin-mdn-links'],
sidebar: {
categoryLabel: '@sapphire/shapeshift',
position: 5,
fullNames: true
}
}
]
],

Expand Down
3 changes: 3 additions & 0 deletions json-parser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
*.tsbuildinfo
log_file.ini
33 changes: 33 additions & 0 deletions json-parser/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "json-parser",
"version": "0.0.1",
"description": "Parses API documentation from typedoc-json-parser to markdown files for Docusaurus.",
"type": "module",
"main": "dist/cli.mjs",
"files": [
"dist/"
],
"scripts": {
"build": "tsup",
"debug": "node --inspect dist/cli.mjs",
"start": "NODE_NO_WARNINGS=1 node dist/cli.mjs 2>&1 | tee log_file.ini",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@sapphire/fetch": "^2.4.1",
"@sapphire/result": "^2.6.4",
"@sapphire/utilities": "^3.13.0",
"colorette": "^2.0.20",
"common-tags": "^1.8.2",
"css": "^3.0.0",
"typedoc-json-parser": "^9.0.1"
},
"devDependencies": {
"@docusaurus/types": "^2.4.3",
"@types/common-tags": "^1.8.2",
"dotenv": "^16.3.1",
"esbuild-plugin-file-path-extensions": "^1.0.0",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
}
}
12 changes: 12 additions & 0 deletions json-parser/src/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env node

import { docusaurusTypeDocJsonParser } from './parser';
import { config } from 'dotenv';
import { URLSearchParams } from 'node:url';

config();

await docusaurusTypeDocJsonParser({
githubContentUrl: `https://api.github.com/repos/sapphiredev/docs/contents/docs?${new URLSearchParams({ ref: 'main' })}`,
githubToken: process.env.GITHUB_TOKEN
});
Loading

0 comments on commit b8be493

Please sign in to comment.