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

Reapply "docs: exclude inherits, update deps (#12628)" (#12645) #12690

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ packages/next-auth/providers
# copied from @auth/core
packages/frameworks-*/**/providers
packages/*/*.js
!packages/*/typedoc.config.js
Copy link
Member Author

Choose a reason for hiding this comment

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

have to convert some files to .js so this will prevent the file from being deleted by clean scripts

packages/*/*.d.ts
packages/*/*.d.ts.map
packages/*/lib
Expand Down
2 changes: 1 addition & 1 deletion docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default withNextra({
{
source: "/:path(.*)",
has: [{ type: "host", value: "warnings.authjs.dev" }],
destination: "https://authjs.dev/reference/warnings/:path*",
destination: "https://authjs.dev/reference/core/errors#warningcode",
Copy link
Member Author

Choose a reason for hiding this comment

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

TBD: should we put warning code under /errors or we make a new file for it in the source code.

permanent: true,
},
{
Expand Down
10 changes: 6 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"start": "next start",
"lint": "eslint ./{components,pages,utils}",
"lint:fix": "eslint ./{components,pages,utils} --fix",
"build:sitemap": "next-sitemap --config next-sitemap.config.cjs"
"build:sitemap": "next-sitemap --config next-sitemap.config.cjs",
"clean": "rm -rf .next build pages/reference/**/*.mdx pages/reference/*.mdx"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -49,8 +50,9 @@
"postcss": "^8.4.47",
"shiki": "^1.22.0",
"tailwindcss": "^3.4.13",
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "4.0.0-next.54",
"typedoc-plugin-mdn-links": "^3.3.2"
"typedoc": "^0.27.6",
"typedoc-plugin-markdown": "4.3.3",
"typedoc-plugin-mdn-links": "4.0.11",
"typedoc-plugin-no-inherit": "^1.5.0"
}
}
6 changes: 1 addition & 5 deletions docs/pages/reference/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ export default {
express: "@auth/express",
qwik: "@auth/qwik",
"solid-start": "@auth/solid-start",
warnings: "Warnings",
errors: {
title: "Errors",
href: "/reference/core/errors",
},
"--- adapters": {
type: "separator",
title: "Adapters",
Expand All @@ -33,6 +28,7 @@ export default {
"mikro-orm-adapter": "@auth/mikro-orm-adapter",
"mongodb-adapter": "@auth/mongodb-adapter",
"neo4j-adapter": "@auth/neo4j-adapter",
"neon-adapter": "@auth/neon-adapter",
"pg-adapter": "@auth/pg-adapter",
"pouchdb-adapter": "@auth/pouchdb-adapter",
"sequelize-adapter": "@auth/sequelize-adapter",
Expand Down
23 changes: 0 additions & 23 deletions docs/pages/reference/warnings.mdx

This file was deleted.

20 changes: 12 additions & 8 deletions docs/typedoc-nextauth.cjs → docs/typedoc-nextauth.js
Copy link
Member Author

Choose a reason for hiding this comment

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

had to convert this file to ESM because of [email protected]

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// @ts-check

const { MarkdownPageEvent } = require("typedoc-plugin-markdown")
const path = require("path")
const fs = require("fs")
import { MarkdownPageEvent } from "typedoc-plugin-markdown"
import path from "path"
import fs from "fs"

/**
* Local plugin to tweak TypeDoc output for nextra docs
*
* @param {import("typedoc-plugin-markdown").MarkdownApplication} app
*/
module.exports.load = (app) => {
export function load(app) {
injectNextraCalloutImport(app)
parseOutput(app)
writeMetaJsFiles(app)
Expand Down Expand Up @@ -82,7 +82,7 @@ function writeMetaJsFiles(app) {
) => {
const pages = defaultValue
navigationItems.forEach((item) => {
const pageKey = item.url ? path.parse(item.url).name : null
const pageKey = item.path ? path.parse(item.path).name : null
if (pageKey) {
pages[pageKey] = item.title
if (item?.children && item?.children?.length > 0) {
Expand All @@ -101,15 +101,19 @@ function writeMetaJsFiles(app) {

const metaJString = `
export default ${JSON.stringify(pages, null, 2)}`

if (new RegExp(".*docs/pages/reference$").test(outputDirectory)) return

fs.writeFileSync(path.join(outputDirectory, "_meta.js"), metaJString)
}

/**
* Recursively write _meta.js files for each page based on output.navigation
*/
writeMetaJs(output.navigation, output.outputDirectory, {
overview: "Overview",
})
if (output.navigation) {
writeMetaJs(output.navigation, output.outputDirectory, {
overview: "Overview",
})
}
})
}
8 changes: 3 additions & 5 deletions docs/typedoc.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ module.exports = {
tsconfig: "./tsconfig.json",
plugin: [
"typedoc-plugin-markdown",
require.resolve("./typedoc-nextauth.cjs"),
require.resolve("./typedoc-nextauth.js"),
"typedoc-plugin-mdn-links",
"typedoc-plugin-no-inherit",
],
disableSources: true,
excludeNotDocumented: true,
excludeExternals: true,
excludeInternal: true,
excludePrivate: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

is now the default

excludeProtected: true,
excludeReferences: true,
cleanOutputDir: false,
gitRevision: "main",
githubPages: false,
Expand Down Expand Up @@ -75,8 +76,5 @@ module.exports = {
expandObjects: true,
parametersFormat: "table",
indexFormat: "table",
textContentMappings: {
Copy link
Member Author

@ThangHuuVu ThangHuuVu Feb 23, 2025

Choose a reason for hiding this comment

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

not sure about this - I feel like it's unnecessary. This option is also deprecated

"label.packages": "Integrations",
},
useCodeBlocks: true,
}
6 changes: 3 additions & 3 deletions packages/adapter-kysely/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding: 16}}>
* <p>Official <a href="https://kysely.dev/">Kysely</a> adapter for Auth.js / NextAuth.js.</p>
* <a href="https://kysely.dev/">
* <img style={{display: "block"}} src="/img/adapters/kysely.svg" width="38" />
* <img style={{display: "block"}} src="https://authjs.dev/img/adapters/kysely.svg" width="30" />
* </a>
* </div>
*
* ## Installation
*
* ```bash npm2yarn
* npm install kysely @auth/kysely-adapter
* npm install @auth/kysely-adapter kysely
* ```
*
* @module @auth/kysely-adapter
*/

import { Kysely, SqliteAdapter } from "kysely"

import {
Expand Down Expand Up @@ -205,6 +204,7 @@ export function KyselyAdapter(db: Kysely<Database>): Adapter {
* requires. When used with `kysely-codegen`, the `Codegen` type can be passed as
* the second generic argument. The generated types will be used, and
* `KyselyAuth` will only verify that the correct fields exist.
* @noInheritDoc
*/
export class KyselyAuth<DB extends T, T = Database> extends Kysely<DB> {}

Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-mongodb/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface MongoDBAdapterOptions {
databaseName?: string
/**
* Callback function for managing the closing of the MongoDB client.
* This could be useful when `client` is provided as a function returning MongoClient | Promise<MongoClient>.
* This could be useful when `client` is provided as a function returning MongoClient.
* It allows for more customized management of database connections,
* addressing persistence, container reuse, and connection closure issues.
*/
Expand Down Expand Up @@ -115,7 +115,7 @@ export function MongoDBAdapter(
* - A promise that resolves to a connected `MongoClient` (not recommended).
* - A function, to handle more complex and custom connection strategies.
*
* Using a function that returns `MongoClient | Promise<MongoClient>`, combined with `options.onClose`, can be useful when you want a more advanced and customized connection strategy to address challenges related to persistence, container reuse, and connection closure.
* Using a function combined with `options.onClose`, can be useful when you want a more advanced and customized connection strategy to address challenges related to persistence, container reuse, and connection closure.
*/
client:
| MongoClient
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"access": "public"
},
"scripts": {
"clean": "rm ./prisma/dev.db* || echo 'File deleted' && rm -rf *.js *.d.ts*",
"clean": "rm ./prisma/dev.db* || echo 'File deleted' && rm -rf index.js *.d.ts*",
"init:default": "prisma migrate dev --name init --skip-seed",
"init:custom": "prisma migrate dev --name init-custom --schema ./prisma/custom.prisma",
"test:default": "pnpm init:default && vitest run -c ../utils/vitest.config.ts",
Expand Down
18 changes: 0 additions & 18 deletions packages/adapter-prisma/typedoc.config.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions packages/adapter-prisma/typedoc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
entryPoints: ["src/index.ts"],
entryPointStrategy: "expand",
tsconfig: "./tsconfig.json",
entryModule: "@auth/prisma-adapter",
entryFileName: "../prisma-adapter.mdx",
includeVersion: true,
readme: 'none',
};
Loading
Loading