Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: generate static imports for types with api-extractor
  • Loading branch information
iCrawl committed Apr 17, 2023
1 parent 516c461 commit 98a76db
Show file tree
Hide file tree
Showing 31 changed files with 209 additions and 143 deletions.
4 changes: 2 additions & 2 deletions api-extractor.json
Expand Up @@ -181,7 +181,7 @@
/**
* (REQUIRED) Whether to generate the .d.ts rollup file.
*/
"enabled": false
"enabled": true,

/**
* Specifies the output path for a .d.ts rollup file to be generated without any trimming.
Expand All @@ -195,7 +195,7 @@
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts"
*/
// "untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
"untrimmedFilePath": "<projectFolder>/dist-docs/index.d.ts"

/**
* Specifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release.
Expand Down
4 changes: 2 additions & 2 deletions apps/guide/package.json
Expand Up @@ -49,7 +49,7 @@
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^0.1.11",
"@vercel/edge-config": "^0.1.7",
"@vercel/og": "^0.5.2",
"@vercel/og": "^0.5.3",
"ariakit": "^2.0.0-next.44",
"cmdk": "^0.2.0",
"contentlayer": "^0.3.1",
Expand Down Expand Up @@ -85,7 +85,7 @@
"eslint": "^8.38.0",
"eslint-config-neon": "^0.1.42",
"eslint-formatter-pretty": "^5.0.0",
"happy-dom": "^9.7.1",
"happy-dom": "^9.8.0",
"hast-util-to-string": "^2.0.0",
"hastscript": "^7.2.0",
"html-escaper": "^3.0.3",
Expand Down
6 changes: 3 additions & 3 deletions apps/website/package.json
Expand Up @@ -54,13 +54,13 @@
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^0.1.11",
"@vercel/edge-config": "^0.1.7",
"@vercel/og": "^0.5.2",
"@vercel/og": "^0.5.3",
"@vscode/codicons": "^0.0.32",
"ariakit": "^2.0.0-next.44",
"bright": "^0.7.1",
"cmdk": "^0.2.0",
"meilisearch": "^0.32.3",
"next": "^13.3.1-canary.8",
"next": "^13.3.1-canary.9",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
Expand Down Expand Up @@ -93,7 +93,7 @@
"eslint": "^8.38.0",
"eslint-config-neon": "^0.1.42",
"eslint-formatter-pretty": "^5.0.0",
"happy-dom": "^9.7.1",
"happy-dom": "^9.8.0",
"lighthouse": "^10.1.1",
"prettier": "^2.8.7",
"typescript": "^5.0.4",
Expand Down
4 changes: 4 additions & 0 deletions packages/brokers/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
2 changes: 1 addition & 1 deletion packages/brokers/package.json
Expand Up @@ -9,7 +9,7 @@
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/brokers/*'",
"release": "cliff-jumper"
Expand Down
4 changes: 4 additions & 0 deletions packages/builders/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
4 changes: 2 additions & 2 deletions packages/builders/package.json
Expand Up @@ -9,7 +9,7 @@
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/builders/*'",
"release": "cliff-jumper"
Expand Down Expand Up @@ -58,7 +58,7 @@
"@discordjs/formatters": "workspace:^",
"@discordjs/util": "workspace:^",
"@sapphire/shapeshift": "^3.8.2",
"discord-api-types": "^0.37.38",
"discord-api-types": "^0.37.39",
"fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.3",
"tslib": "^2.5.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/collection/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
2 changes: 1 addition & 1 deletion packages/collection/package.json
Expand Up @@ -9,7 +9,7 @@
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
"release": "cliff-jumper"
Expand Down
4 changes: 4 additions & 0 deletions packages/core/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
4 changes: 2 additions & 2 deletions packages/core/package.json
Expand Up @@ -8,7 +8,7 @@
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --fix --format=pretty",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/core/*'",
"release": "cliff-jumper"
Expand Down Expand Up @@ -58,7 +58,7 @@
"@discordjs/ws": "workspace:^",
"@sapphire/snowflake": "^3.4.2",
"@vladfrangu/async_event_emitter": "^2.2.1",
"discord-api-types": "^0.37.38"
"discord-api-types": "^0.37.39"
},
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/discord.js/package.json
Expand Up @@ -56,7 +56,7 @@
"@discordjs/util": "workspace:^",
"@sapphire/snowflake": "^3.4.2",
"@types/ws": "^8.5.4",
"discord-api-types": "^0.37.38",
"discord-api-types": "^0.37.39",
"fast-deep-equal": "^3.1.3",
"lodash.snakecase": "^4.1.1",
"tslib": "^2.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/docgen/package.json
Expand Up @@ -43,7 +43,7 @@
"commander": "^10.0.1",
"jsdoc-to-markdown": "^8.0.0",
"tslib": "^2.5.0",
"typedoc": "^0.24.1"
"typedoc": "^0.24.4"
},
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/formatters/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
4 changes: 2 additions & 2 deletions packages/formatters/package.json
Expand Up @@ -8,7 +8,7 @@
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/formatters/*'",
"release": "cliff-jumper"
Expand Down Expand Up @@ -45,7 +45,7 @@
},
"homepage": "https://discord.js.org",
"dependencies": {
"discord-api-types": "^0.37.38"
"discord-api-types": "^0.37.39"
},
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/next/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
4 changes: 2 additions & 2 deletions packages/next/package.json
Expand Up @@ -8,7 +8,7 @@
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/next/*'",
"release": "cliff-jumper"
Expand Down Expand Up @@ -59,7 +59,7 @@
"@discordjs/rest": "workspace:^",
"@discordjs/util": "workspace:^",
"@discordjs/ws": "workspace:^",
"discord-api-types": "^0.37.38"
"discord-api-types": "^0.37.39"
},
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/proxy/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
2 changes: 1 addition & 1 deletion packages/proxy/package.json
Expand Up @@ -9,7 +9,7 @@
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/proxy/*'",
"release": "cliff-jumper"
Expand Down
4 changes: 4 additions & 0 deletions packages/rest/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
4 changes: 2 additions & 2 deletions packages/rest/package.json
Expand Up @@ -9,7 +9,7 @@
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/rest/*'",
"release": "cliff-jumper"
Expand Down Expand Up @@ -57,7 +57,7 @@
"@discordjs/util": "workspace:^",
"@sapphire/async-queue": "^1.5.0",
"@sapphire/snowflake": "^3.4.2",
"discord-api-types": "^0.37.38",
"discord-api-types": "^0.37.39",
"file-type": "^18.2.1",
"tslib": "^2.5.0",
"undici": "^5.21.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/template/template.package.json
Expand Up @@ -8,7 +8,7 @@
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/{name}/*'",
"release": "cliff-jumper"
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
2 changes: 1 addition & 1 deletion packages/ui/package.json
Expand Up @@ -79,7 +79,7 @@
"typescript": "^5.0.4",
"unocss": "^0.51.4",
"vite": "^4.2.1",
"vite-plugin-dts": "^2.2.0",
"vite-plugin-dts": "^2.3.0",
"vitest": "^0.29.8"
},
"engines": {
Expand Down
4 changes: 4 additions & 0 deletions packages/util/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
2 changes: 1 addition & 1 deletion packages/util/package.json
Expand Up @@ -9,7 +9,7 @@
"lint": "prettier --check . && TIMING=1 eslint src --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && TIMING=1 eslint src --ext .mjs,.js,.ts --fix --format=pretty",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/util/*'",
"release": "cliff-jumper"
Expand Down
4 changes: 4 additions & 0 deletions packages/voice/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
4 changes: 2 additions & 2 deletions packages/voice/package.json
Expand Up @@ -9,7 +9,7 @@
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/voice/*'",
"release": "cliff-jumper"
Expand Down Expand Up @@ -54,7 +54,7 @@
"homepage": "https://discord.js.org",
"dependencies": {
"@types/ws": "^8.5.4",
"discord-api-types": "^0.37.38",
"discord-api-types": "^0.37.39",
"prism-media": "^1.3.5",
"tslib": "^2.5.0",
"ws": "^8.13.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/ws/api-extractor-docs.json
@@ -0,0 +1,4 @@
{
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts"
}
4 changes: 2 additions & 2 deletions packages/ws/package.json
Expand Up @@ -8,7 +8,7 @@
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"docs": "yarn build:docs && api-extractor run --local",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/ws/*'",
"release": "cliff-jumper"
Expand Down Expand Up @@ -65,7 +65,7 @@
"@sapphire/async-queue": "^1.5.0",
"@types/ws": "^8.5.4",
"@vladfrangu/async_event_emitter": "^2.2.1",
"discord-api-types": "^0.37.38",
"discord-api-types": "^0.37.39",
"tslib": "^2.5.0",
"ws": "^8.13.0"
},
Expand Down

2 comments on commit 98a76db

@vercel
Copy link

@vercel vercel bot commented on 98a76db Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 98a76db Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.