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

docs: rewrite api-docs generation using ts-morph #2628

Merged
merged 92 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
4520072
docs: start apidocs rewrite
ST-DDT Jan 28, 2024
5653744
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Jan 28, 2024
8525954
chore: cleanup
ST-DDT Jan 28, 2024
93463b5
chore: cleanup
ST-DDT Jan 28, 2024
72f8b8d
feat: process modules
ST-DDT Jan 28, 2024
be8463c
docs: fix missing or invalid jsdocs
ST-DDT Jan 28, 2024
8e5dcd2
Merge branch 'jsdoc/signature-fixes' into docs/apidocs-rewrite
ST-DDT Jan 28, 2024
72edf49
feat: write most files
ST-DDT Jan 28, 2024
837d01f
refactor: reduce diff to previous file output
ST-DDT Jan 28, 2024
2e9ef10
Update src/faker.ts
ST-DDT Jan 29, 2024
9c897eb
chore: adjust to match other examples
ST-DDT Jan 29, 2024
2da0579
Merge remote-tracking branch 'origin/jsdoc/signature-fixes' into docs…
ST-DDT Jan 29, 2024
c1a3d76
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 1, 2024
9aebed1
finish extracting data for all pages
ST-DDT Feb 1, 2024
2a87182
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 2, 2024
4b51132
type parameters + partially options parameters
ST-DDT Feb 3, 2024
de23b8f
partially some more options parameters
ST-DDT Feb 3, 2024
dc10a86
docs: missing options jsdocs
ST-DDT Feb 3, 2024
d07fe0e
Merge remote-tracking branch 'origin/jsdoc/once-again' into docs/apid…
ST-DDT Feb 3, 2024
ad8a2df
chore: reduce diff
ST-DDT Feb 3, 2024
e978a14
convert md
ST-DDT Feb 3, 2024
fa5202f
generate signatures
ST-DDT Feb 4, 2024
b517839
chore: one more
ST-DDT Feb 4, 2024
40d87c7
add comment
ST-DDT Feb 4, 2024
bb89864
Merge branch 'jsdoc/once-again' into docs/apidocs-rewrite
ST-DDT Feb 4, 2024
e578331
fix comments
ST-DDT Feb 4, 2024
15e9136
apply correct output formatting
ST-DDT Feb 5, 2024
511b4c8
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 5, 2024
ddb8c91
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 7, 2024
fb75a24
various improvements
ST-DDT Feb 7, 2024
6e2ab30
reduce diff to current api docs
ST-DDT Feb 7, 2024
b75c7c2
handle string literals
ST-DDT Feb 8, 2024
c4f10eb
adjust renovate config
ST-DDT Feb 8, 2024
3335006
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 9, 2024
426a6ac
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 9, 2024
ab81003
prepare some crazy type stuff
ST-DDT Feb 10, 2024
6840e5f
chore: sort according to TS
ST-DDT Feb 10, 2024
e92b8b2
chore: complete json data
ST-DDT Feb 10, 2024
4105590
chore: cleanup
ST-DDT Feb 10, 2024
f0395bc
chore: adjust md data
ST-DDT Feb 10, 2024
632c77e
chore: write source base url
ST-DDT Feb 10, 2024
46f07a1
remove most dev code
ST-DDT Feb 10, 2024
df66066
chore: replace old implementation
ST-DDT Feb 10, 2024
4462ce9
chore: repair diff
ST-DDT Feb 10, 2024
827b019
chore: repair diff
ST-DDT Feb 10, 2024
259fed8
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 11, 2024
affb686
chore: restructure files
ST-DDT Feb 11, 2024
b519692
chore: formatting
ST-DDT Feb 11, 2024
4dc3702
refactor: error handling
ST-DDT Feb 11, 2024
96270c5
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 17, 2024
26566db
adjust tests
ST-DDT Feb 17, 2024
072b90b
bypass error in Faker constructor example + add code comments
ST-DDT Feb 17, 2024
8ccd1d8
fix tests and jsdoc errors
ST-DDT Feb 18, 2024
b5caea7
fix tests
ST-DDT Feb 18, 2024
e0fa001
cleanup
ST-DDT Feb 18, 2024
151a3cc
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 19, 2024
4d28082
chore: fix lint errors
ST-DDT Feb 19, 2024
c2d9f7b
chore: use required
ST-DDT Feb 19, 2024
63ced82
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 19, 2024
43464f0
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 21, 2024
42731ab
chore: add code to simplify review
ST-DDT Feb 21, 2024
298ab3e
chore: revert dev files
ST-DDT Feb 21, 2024
11e4459
Update test/scripts/apidoc/method.example.ts
ST-DDT Feb 22, 2024
5a17b30
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 22, 2024
5430a5f
update snapshots
ST-DDT Feb 22, 2024
99dfaee
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 24, 2024
1343be9
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 25, 2024
f05e3da
chore: apply some suggestions
ST-DDT Feb 25, 2024
76b93fc
Update scripts/apidoc/output/page.ts
ST-DDT Feb 25, 2024
8e97cc4
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 26, 2024
bf7f8fa
chore: rename hashs
ST-DDT Feb 26, 2024
0638f06
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Feb 27, 2024
e077c93
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 1, 2024
c9ed6e8
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 5, 2024
bdb73f9
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 9, 2024
8e960c4
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 11, 2024
b46ec96
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 13, 2024
47353b5
chore: remove debug utils
ST-DDT Mar 13, 2024
f1053b2
chore: remove debug utils
ST-DDT Mar 13, 2024
3ddc4ef
chore: package.json cleanup
ST-DDT Mar 13, 2024
a21708d
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 15, 2024
b660fe4
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 21, 2024
3a498e5
chore: consistent apidocs naming
ST-DDT Mar 22, 2024
40cb5db
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 23, 2024
1898289
refactor: change source handling
ST-DDT Mar 23, 2024
6a9d735
test: update tests
ST-DDT Mar 23, 2024
2593ade
refactor: simplify code
ST-DDT Mar 23, 2024
2225993
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 28, 2024
79ed741
chore: remove old snapshots
ST-DDT Mar 29, 2024
d55a913
chore: address review comments
ST-DDT Mar 29, 2024
6497892
Merge branch 'next' into docs/apidocs-rewrite
ST-DDT Mar 29, 2024
a92711c
simplify and better LiteralUnion support
ST-DDT Mar 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
7 changes: 1 addition & 6 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@
},
{
"groupName": "doc-dependencies",
"matchPackageNames": [
"@algolia/client-search",
"typedoc",
"typedoc-plugin-missing-exports",
"vitepress"
]
"matchPackageNames": ["@algolia/client-search", "ts-morph", "vitepress"]
}
],
"vulnerabilityAlerts": {
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.pnpm-store/
coverage/
dist/
test/scripts/apidoc/temp/
test/scripts/apidocs/temp/
CHANGELOG.md
CHANGELOG_old.md
pnpm-lock.yaml
4 changes: 2 additions & 2 deletions docs/.vitepress/components/api-docs/method-parameters.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { MethodParameter } from './method';
import type { ApiDocsMethodParameter } from './method';

const props = defineProps<{ parameters: MethodParameter[] }>();
const props = defineProps<{ parameters: ApiDocsMethodParameter[] }>();
</script>

<template>
Expand Down
18 changes: 9 additions & 9 deletions docs/.vitepress/components/api-docs/method.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
export interface Method {
export interface ApiDocsMethod {
ST-DDT marked this conversation as resolved.
Show resolved Hide resolved
readonly name: string;
readonly deprecated: string | undefined; // HTML
readonly description: string; // HTML
readonly parameters: MethodParameter[];
readonly since: string;
readonly parameters: ApiDocsMethodParameter[];
readonly returns: string;
readonly throws: string | undefined; // HTML
readonly examples: string; // HTML
readonly deprecated?: string; // HTML
readonly since: string;
readonly sourcePath: string; // URL-Suffix
readonly seeAlsos: string[];
readonly throws?: string; // HTML
readonly sourcePath: string; // URL-Suffix
}

export interface MethodParameter {
export interface ApiDocsMethodParameter {
readonly name: string;
readonly type?: string;
readonly default?: string;
readonly type: string | undefined;
readonly default: string | undefined;
readonly description: string; // HTML
}
4 changes: 2 additions & 2 deletions docs/.vitepress/components/api-docs/method.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import type { Method } from './method';
import type { ApiDocsMethod } from './method';
import MethodParameters from './method-parameters.vue';
import { slugify } from '../../shared/utils/slugify';
import { sourceBaseUrl } from '../../../api/source-base-url';

const props = defineProps<{ method: Method }>();
const props = defineProps<{ method: ApiDocsMethod }>();

function seeAlsoToUrl(see: string): string {
const [, module, method] = see.replace(/\(.*/, '').split('\.');
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@
"build:types": "tsc --project tsconfig.build.json",
"build": "run-s build:clean build:code build:types",
"generate": "run-s generate:locales generate:api-docs",
"generate:api-docs": "tsx ./scripts/apidoc.ts",
"generate:api-docs": "tsx ./scripts/apidocs.ts",
"generate:locales": "tsx ./scripts/generate-locales.ts",
"docs:build": "run-s docs:prepare docs:build:run",
"docs:build": "run-s generate:api-docs docs:build:run",
"docs:build:run": "vitepress build docs",
"docs:build:ci": "run-s build docs:build",
"docs:prepare": "run-s generate:api-docs",
"docs:dev": "run-s docs:prepare docs:dev:run",
"docs:dev": "run-s generate:api-docs docs:dev:run",
"docs:dev:run": "vitepress dev docs",
"docs:serve": "vitepress serve docs --port 5173",
"docs:diff": "tsx ./scripts/diff.ts",
Expand Down Expand Up @@ -126,9 +125,9 @@
"sanitize-html": "2.13.0",
"semver": "7.6.0",
"standard-version": "9.5.0",
"ts-morph": "22.0.0",
"tsup": "8.0.2",
"tsx": "4.7.1",
"typedoc": "0.25.12",
"typescript": "5.4.3",
"validator": "13.11.0",
"vite": "5.2.6",
Expand Down
81 changes: 33 additions & 48 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions scripts/apidoc.ts

This file was deleted.

86 changes: 0 additions & 86 deletions scripts/apidoc/faker-class.ts

This file was deleted.

Loading