mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
ci: update scripts for documentation changes (#9055)
* ci: update scripts for documentation changes * refactor: use tsconfig files Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"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",
|
||||
"fmt": "yarn format",
|
||||
|
||||
7
packages/brokers/tsconfig.docs.json
Normal file
7
packages/brokers/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\" && yarn downlevel-dts ./dist-docs ./dist-docs",
|
||||
"build:docs": "tsc -p tsconfig.docs.json && yarn downlevel-dts ./dist-docs ./dist-docs",
|
||||
"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",
|
||||
|
||||
8
packages/builders/tsconfig.docs.json
Normal file
8
packages/builders/tsconfig.docs.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs",
|
||||
"exactOptionalPropertyTypes": false
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,14 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"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",
|
||||
"fmt": "yarn format",
|
||||
"docs": "yarn build:docs && api-extractor run --local",
|
||||
"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",
|
||||
"docs:declarations": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist\""
|
||||
"release": "cliff-jumper"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
|
||||
7
packages/collection/tsconfig.docs.json
Normal file
7
packages/collection/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"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",
|
||||
|
||||
7
packages/core/tsconfig.docs.json
Normal file
7
packages/core/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"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",
|
||||
|
||||
7
packages/formatters/tsconfig.docs.json
Normal file
7
packages/formatters/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"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",
|
||||
|
||||
7
packages/next/tsconfig.docs.json
Normal file
7
packages/next/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"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",
|
||||
"fmt": "yarn format",
|
||||
|
||||
7
packages/proxy/tsconfig.docs.json
Normal file
7
packages/proxy/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"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",
|
||||
"fmt": "yarn format",
|
||||
|
||||
7
packages/rest/tsconfig.docs.json
Normal file
7
packages/rest/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { chdir } from 'node:process';
|
||||
import { copy } from 'fs-extra';
|
||||
import { parse as parseYAML, stringify as stringifyYAML } from 'yaml';
|
||||
import cliffJumperJSON from './template/.cliff-jumperrc.json';
|
||||
import apiExtractorJSON from './template/api-extractor.json';
|
||||
import templateJSON from './template/template.package.json';
|
||||
|
||||
interface LabelerData {
|
||||
@@ -52,6 +53,15 @@ export async function createPackage(packageName: string, packageDescription?: st
|
||||
|
||||
await writeFile('.cliff-jumperrc.json', JSON.stringify(newCliffJumperJSON, null, 2));
|
||||
|
||||
// Update api-extractor.json
|
||||
const newApiExtractorJSON = { ...apiExtractorJSON };
|
||||
newApiExtractorJSON.docModel.projectFolderUrl = newApiExtractorJSON.docModel.projectFolderUrl.replace(
|
||||
'{name}',
|
||||
packageName,
|
||||
);
|
||||
|
||||
await writeFile('api-extractor.json', JSON.stringify(newApiExtractorJSON, null, 2));
|
||||
|
||||
// Move to github directory
|
||||
chdir(join('..', '..', '.github'));
|
||||
|
||||
|
||||
6
packages/scripts/src/template/api-extractor.json
Normal file
6
packages/scripts/src/template/api-extractor.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../../api-extractor.json",
|
||||
"docModel": {
|
||||
"projectFolderUrl": "https://github.com/discordjs/discord.js/tree/main/packages/{name}"
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "../../api-extractor.json"
|
||||
}
|
||||
7
packages/scripts/src/template/default/tsconfig.docs.json
Normal file
7
packages/scripts/src/template/default/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,10 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"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": "api-extractor run --local",
|
||||
"docs": "yarn build:docs && api-extractor run --local",
|
||||
"prepack": "yarn build && yarn lint",
|
||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/{name}/*'",
|
||||
"release": "cliff-jumper"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Utilities shared across Discord.js packages",
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"build:docs": "tsc -p tsconfig.docs.json",
|
||||
"test": "vitest run && tsd",
|
||||
"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",
|
||||
|
||||
7
packages/util/tsconfig.docs.json
Normal file
7
packages/util/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Implementation of the Discord Voice API for node.js",
|
||||
"scripts": {
|
||||
"build": "tsup && node scripts/postbuild.mjs",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"build:docs": "tsc -p tsconfig.docs.json",
|
||||
"test": "jest --coverage",
|
||||
"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",
|
||||
|
||||
7
packages/voice/tsconfig.docs.json
Normal file
7
packages/voice/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build:docs": "tsc --emitDeclarationOnly --declarationMap --skipLibCheck --outDir \"dist-docs\"",
|
||||
"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",
|
||||
|
||||
7
packages/ws/tsconfig.docs.json
Normal file
7
packages/ws/tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.docs.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-docs"
|
||||
}
|
||||
}
|
||||
7
tsconfig.docs.json
Normal file
7
tsconfig.docs.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"emitDeclarationOnly": true,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
||||
@@ -130,8 +130,7 @@
|
||||
"outputs": []
|
||||
},
|
||||
"docs": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["../../api-extractor.json", "api-extractor.json", "docs/**", "tsconfig.json"]
|
||||
"outputs": ["../../api-extractor.json", "api-extractor.json", "docs/**", "tsconfig.json", "dist-docs"]
|
||||
},
|
||||
"changelog": {
|
||||
"outputs": ["cliff.toml", "CHANGELOG.md"]
|
||||
|
||||
Reference in New Issue
Block a user