Skip to content

Commit 2f28f94

Browse files
Update prettier [skip ci] (#171)
* update prettier and run it * minify api-docs.json * Update prettier-plugin-tailwindcss
1 parent 7c99675 commit 2f28f94

35 files changed

+144
-103225
lines changed

app/components/color-scheme-toggle.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ let ColorSchemeButton = React.forwardRef<
7070
"flex w-full items-center gap-4 px-4 py-1",
7171
colorScheme === props.value
7272
? "text-red-brand"
73-
: "hover:bg-gray-50 active:text-red-brand dark:hover:bg-gray-700 dark:active:text-red-brand"
73+
: "hover:bg-gray-50 active:text-red-brand dark:hover:bg-gray-700 dark:active:text-red-brand",
7474
)}
7575
>
7676
<svg className="h-[18px] w-[18px]">

app/components/docs-header/data.server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export type HeaderData = Awaited<ReturnType<typeof getHeaderData>>;
99
export async function getHeaderData(
1010
lang: string,
1111
ref: string,
12-
refParam?: string
12+
refParam?: string,
1313
) {
1414
let githubRef = ref;
1515
let branchesInMenu = ["main", "dev"];

app/components/docs-header/docs-header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function HeaderSvgLink({
8787
href={href}
8888
className={classNames(
8989
`hidden text-gray-400 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50 md:block`,
90-
className
90+
className,
9191
)}
9292
title={title}
9393
>

app/components/docs-menu/menu-desktop.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function NavMenuDesktop({ children }: { children: React.ReactNode }) {
66
className={classNames(
77
"sticky bottom-0 top-16 hidden w-[--nav-width] flex-col gap-3 self-start overflow-auto py-6 pl-8 pr-6 lg:flex",
88
// Account for the height of the top nav
9-
"h-[calc(100vh-var(--header-height))]"
9+
"h-[calc(100vh-var(--header-height))]",
1010
)}
1111
>
1212
<div className="[&_*:focus]:scroll-mt-[6rem]">{children}</div>

app/components/docs-menu/menu.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function MenuSummary({ children }: { children: React.ReactNode }) {
132132
sharedClassName,
133133
"_no-triangle block cursor-pointer select-none",
134134
"outline-none focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-red-brand dark:focus-visible:ring-gray-100",
135-
"hover:bg-gray-50 active:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-800 dark:active:bg-gray-700"
135+
"hover:bg-gray-50 active:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-800 dark:active:bg-gray-700",
136136
)}
137137
>
138138
<div className="flex h-5 w-full items-center justify-between font-bold">
@@ -157,7 +157,7 @@ function HeaderMenuLink({
157157
"relative -mx-4 flex items-center justify-between rounded-md px-4 py-3 font-bold",
158158
isActive
159159
? "bg-gray-50 font-semibold text-red-brand dark:bg-gray-800"
160-
: "hover:bg-gray-50 active:text-red-brand dark:hover:bg-gray-800 dark:active:text-red-brand"
160+
: "hover:bg-gray-50 active:text-red-brand dark:hover:bg-gray-800 dark:active:text-red-brand",
161161
)
162162
}
163163
>
@@ -175,7 +175,7 @@ function MenuLink({ to, children }: { to: string; children: React.ReactNode }) {
175175
"relative -mx-2 flex items-center justify-between rounded-md px-4 py-1.5 lg:text-sm",
176176
isActive
177177
? "bg-gray-50 font-semibold text-red-brand dark:bg-gray-800"
178-
: "text-gray-400 hover:text-gray-800 active:text-red-brand dark:text-gray-400 dark:hover:text-gray-50 dark:active:text-red-brand"
178+
: "text-gray-400 hover:text-gray-800 active:text-red-brand dark:text-gray-400 dark:hover:text-gray-50 dark:active:text-red-brand",
179179
)
180180
}
181181
>

app/components/on-this-page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function LargeOnThisPage({
6969
className={classNames(
7070
activeHeading == heading.slug &&
7171
"text-gray-900 dark:text-gray-50",
72-
" block py-1 text-sm text-gray-400 hover:text-gray-900 active:text-red-brand dark:text-gray-400 dark:hover:text-gray-50 dark:active:text-red-brand"
72+
" block py-1 text-sm text-gray-400 hover:text-gray-900 active:text-red-brand dark:text-gray-400 dark:hover:text-gray-50 dark:active:text-red-brand",
7373
)}
7474
/>
7575
</li>

app/components/package-select.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function PackageLink({
5252
<span
5353
className={classNames(
5454
className,
55-
"font-bold text-red-brand before:bg-red-brand"
55+
"font-bold text-red-brand before:bg-red-brand",
5656
)}
5757
>
5858
{name}
@@ -63,7 +63,7 @@ function PackageLink({
6363
relative="path"
6464
className={classNames(
6565
className,
66-
"hover:bg-gray-50 active:text-red-brand dark:text-gray-200 dark:hover:bg-gray-700 dark:active:text-red-brand"
66+
"hover:bg-gray-50 active:text-red-brand dark:text-gray-200 dark:hover:bg-gray-700 dark:active:text-red-brand",
6767
)}
6868
>
6969
{name}

app/components/version-select.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function VersionSelect() {
2828
title={label}
2929
className={classNames(
3030
`_no-triangle relative flex h-[40px] w-24 cursor-pointer list-none items-center justify-between gap-3 overflow-hidden whitespace-nowrap rounded-full px-3`,
31-
className
31+
className,
3232
)}
3333
>
3434
<div>{label}</div>
@@ -100,7 +100,7 @@ function RefLink({ to, children }: { to: string; children: React.ReactNode }) {
100100
className,
101101
"after:absolute after:right-4 after:top-1 after:block after:-rotate-45 after:opacity-50 after:content-['→']",
102102
// Same as !isActive styles on <Link> below
103-
"hover:bg-gray-50 active:text-red-brand dark:text-gray-200 dark:hover:bg-gray-700 dark:active:text-red-brand"
103+
"hover:bg-gray-50 active:text-red-brand dark:text-gray-200 dark:hover:bg-gray-700 dark:active:text-red-brand",
104104
)}
105105
>
106106
{children}
@@ -114,7 +114,7 @@ function RefLink({ to, children }: { to: string; children: React.ReactNode }) {
114114
className,
115115
isActive
116116
? "font-bold text-red-brand before:bg-red-brand"
117-
: "before:bg-transparent hover:bg-gray-50 active:text-red-brand dark:text-gray-200 dark:hover:bg-gray-700 dark:active:text-red-brand"
117+
: "before:bg-transparent hover:bg-gray-50 active:text-red-brand dark:text-gray-200 dark:hover:bg-gray-700 dark:active:text-red-brand",
118118
)}
119119
to={to}
120120
>

app/hooks/use-navigation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function useNavigation(to?: string, end?: boolean) {
1313

1414
let navigation = Object.assign(
1515
{ isActive: false, isPending: false },
16-
navigation_
16+
navigation_,
1717
);
1818

1919
if (toPathname) {

app/modules/color-scheme/components.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function ColorSchemeScript() {
2828
if (media.matches) document.documentElement.classList.add("dark");
2929
}
3030
`,
31-
[] // eslint-disable-line
31+
[], // eslint-disable-line
3232
// we don't want this script to ever change
3333
);
3434

app/modules/color-scheme/server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export let action: ActionFunction = async ({ request }) => {
4343
};
4444

4545
export function safeRedirect(
46-
to: FormDataEntryValue | string | null | undefined
46+
to: FormDataEntryValue | string | null | undefined,
4747
) {
4848
if (!to || typeof to !== "string") {
4949
return "/";

app/modules/docsearch.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function DocSearch({ children }: { children: React.ReactNode }) {
6262
onOpen,
6363
searchButtonRef,
6464
}),
65-
[onOpen, searchButtonRef]
65+
[onOpen, searchButtonRef],
6666
);
6767

6868
return (
@@ -75,7 +75,7 @@ export function DocSearch({ children }: { children: React.ReactNode }) {
7575
onClose={onClose}
7676
{...docSearchProps}
7777
/>,
78-
document.body
78+
document.body,
7979
)
8080
: null}
8181
</DocSearchContext>

app/modules/gh-docs/.server/docs.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ global.menuCache ??= new LRUCache<string, MenuDoc[]>({
6666
export async function getMenu(
6767
repo: string,
6868
ref: string,
69-
lang: string
69+
lang: string,
7070
): Promise<MenuDoc[] | undefined> {
7171
return menuCache.fetch(`${repo}:${ref}`);
7272
}
7373

7474
function parseAttrs(
7575
md: string,
76-
filename: string
76+
filename: string,
7777
): { content: string; attrs: Doc["attrs"] } {
7878
let { data, content } = parseYamlHeader(md);
7979
return {
@@ -134,7 +134,7 @@ function createTableOfContentsFromHeadings(html: string) {
134134
export async function getDoc(
135135
repo: string,
136136
ref: string,
137-
slug: string
137+
slug: string,
138138
): Promise<Doc | undefined> {
139139
let key = `${repo}:${ref}:${slug}`;
140140
let doc = await docCache.fetch(key);

app/modules/gh-docs/.server/github.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (env !== "test" && !GH_TOKEN) {
99
throw new Error("No GH_TOKEN provided");
1010
}
1111
console.warn(
12-
"\nNo GH_TOKEN provided. You can increase the rate limit from 60/hr to 1000/hr by adding a token to your .env file.\n"
12+
"\nNo GH_TOKEN provided. You can increase the rate limit from 60/hr to 1000/hr by adding a token to your .env file.\n",
1313
);
1414
}
1515

app/modules/gh-docs/.server/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function getRepoDoc(ref: string, slug: string) {
4141
export async function getRepoReferenceDoc(
4242
ref: string,
4343
pkgName: string,
44-
qualifiedName: string
44+
qualifiedName: string,
4545
) {
4646
const api = await getReferenceAPI(REPO, ref);
4747
return api.getDoc(pkgName, qualifiedName);

app/modules/gh-docs/.server/md.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface ProcessorOptions {
2222
let processor: Awaited<ReturnType<typeof getProcessor>>;
2323
export async function processMarkdown(
2424
content: string,
25-
options?: ProcessorOptions
25+
options?: ProcessorOptions,
2626
) {
2727
processor = processor || (await getProcessor(options));
2828
let { attributes, body: raw } = parseFrontMatter(content);
@@ -65,7 +65,7 @@ export async function getProcessor(options?: ProcessorOptions) {
6565

6666
type InternalPlugin<
6767
Input extends string | Unist.Node | undefined,
68-
Output
68+
Output,
6969
> = Unified.Plugin<[ProcessorOptions?], Input, Output>;
7070

7171
export async function loadPlugins() {
@@ -75,7 +75,7 @@ export async function loadPlugins() {
7575
]);
7676

7777
const stripLinkExtPlugin: InternalPlugin<UnistNode.Root, UnistNode.Root> = (
78-
options = {}
78+
options = {},
7979
) => {
8080
return async function transformer(tree: UnistNode.Root) {
8181
visit(tree, "link", (node, index, parent) => {
@@ -107,7 +107,7 @@ export async function loadPlugins() {
107107
theme = theme || toShikiTheme(themeJson as any);
108108
highlighter = highlighter || (await getHighlighter({ themes: [theme] }));
109109
let fgColor = convertFakeHexToCustomProp(
110-
highlighter.getForegroundColor(theme.name) || ""
110+
highlighter.getForegroundColor(theme.name) || "",
111111
);
112112
let langs: Shiki.Lang[] = [
113113
"js",
@@ -174,7 +174,7 @@ export async function loadPlugins() {
174174
children: [content],
175175
}
176176
: content;
177-
}
177+
},
178178
);
179179

180180
children.push({
@@ -205,7 +205,7 @@ export async function loadPlugins() {
205205
},
206206
children,
207207
};
208-
}
208+
},
209209
);
210210

211211
let nodeValue = {

app/modules/gh-docs/.server/reference-docs.ts

+17-17
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function getReferenceAPI(repo: string, ref: string) {
6060
return [[node.qualifiedName, { node, id }]];
6161
};
6262
let symbolMapByQualifiedName = new Map<string, Qualified>(
63-
Object.keys(api.symbolIdMap).map(mapper).flat(1)
63+
Object.keys(api.symbolIdMap).map(mapper).flat(1),
6464
);
6565

6666
function getSymbol(qualifiedName: string) {
@@ -85,29 +85,29 @@ export async function getReferenceAPI(repo: string, ref: string) {
8585
}
8686
if (!symbol) {
8787
symbol = symbolMapByQualifiedName.get(
88-
qualifiedName.replace(/^(unstable|unsafe|internal)_/, "")
88+
qualifiedName.replace(/^(unstable|unsafe|internal)_/, ""),
8989
);
9090
}
9191
return symbol;
9292
}
9393

9494
function getLink(
95-
_qualifiedName: string | number | JSONOutput.ReflectionSymbolId | undefined
95+
_qualifiedName: string | number | JSONOutput.ReflectionSymbolId | undefined,
9696
) {
9797
let qualifiedName =
9898
(typeof _qualifiedName === "string"
9999
? _qualifiedName
100100
: typeof _qualifiedName === "number"
101-
? api.symbolIdMap[_qualifiedName].qualifiedName
102-
: _qualifiedName?.qualifiedName) ?? "";
101+
? api.symbolIdMap[_qualifiedName].qualifiedName
102+
: _qualifiedName?.qualifiedName) ?? "";
103103
let symbol = getSymbol(qualifiedName);
104104
if (!symbol) {
105105
// console.error("No symbol found for", qualifiedName);
106106
return "#";
107107
}
108108
// find the package the qualifiedName belongs to
109109
let pkg = api.children?.find((child) =>
110-
child.children?.some((child) => child.name === qualifiedName)
110+
child.children?.some((child) => child.name === qualifiedName),
111111
);
112112
if (!pkg) {
113113
let split = qualifiedName.split(".");
@@ -116,7 +116,7 @@ export async function getReferenceAPI(repo: string, ref: string) {
116116
popped.push(split.pop());
117117
const splitName = split.join(".");
118118
pkg = api.children?.find((child) =>
119-
child.children?.some((child) => child.name === splitName)
119+
child.children?.some((child) => child.name === splitName),
120120
);
121121
}
122122
if (pkg) {
@@ -154,7 +154,7 @@ export async function getReferenceAPI(repo: string, ref: string) {
154154
async function getDoc(
155155
pkgName: string,
156156
qualifiedName: string,
157-
shouldProcessMarkdown = true
157+
shouldProcessMarkdown = true,
158158
): Promise<Doc | null> {
159159
let pkg = getPackage(pkgName);
160160
let symbol = getSymbol(qualifiedName);
@@ -165,17 +165,17 @@ export async function getReferenceAPI(repo: string, ref: string) {
165165
pkg.children?.find(
166166
(child) =>
167167
child.name === "UNSAFE_" + qualifiedName ||
168-
child.name === "unsafe_" + qualifiedName
168+
child.name === "unsafe_" + qualifiedName,
169169
) ||
170170
pkg.children?.find(
171171
(child) =>
172172
child.name === "UNSTABLE_" + qualifiedName ||
173-
child.name === "unstable_" + qualifiedName
173+
child.name === "unstable_" + qualifiedName,
174174
) ||
175175
pkg.children?.find(
176176
(child) =>
177177
child.name === "INTERNAL_" + qualifiedName ||
178-
child.name === "internal_" + qualifiedName
178+
child.name === "internal_" + qualifiedName,
179179
) ||
180180
null;
181181

@@ -256,7 +256,7 @@ export async function getReferenceAPI(repo: string, ref: string) {
256256
}
257257

258258
function declarationToMarkdown(
259-
declaration: JSONOutput.DeclarationReflection
259+
declaration: JSONOutput.DeclarationReflection,
260260
) {
261261
let md = "";
262262
switch (declaration.kind) {
@@ -409,7 +409,7 @@ export async function getReferenceAPI(repo: string, ref: string) {
409409
return `${formatType(type.elementType)}[]`;
410410
case "conditional":
411411
return `${formatType(type.checkType)} ? ${formatType(
412-
type.extendsType
412+
type.extendsType,
413413
)} : ${formatType(type.falseType)}`;
414414
case "indexedAccess":
415415
return `${formatType(type.objectType)}[${formatType(type.indexType)}]`;
@@ -426,7 +426,7 @@ export async function getReferenceAPI(repo: string, ref: string) {
426426
return JSON.stringify(type.value);
427427
case "mapped":
428428
return `{ [${type.parameter} in ${formatType(
429-
type.parameterType
429+
type.parameterType,
430430
)}]: ${formatType(type.templateType)} }`;
431431
case "namedTupleMember":
432432
return `${type.name}: ${formatType(type.element)}`;
@@ -471,7 +471,7 @@ export async function getReferenceAPI(repo: string, ref: string) {
471471
function formatTypeDeclaration(
472472
declaration:
473473
| JSONOutput.ReferenceReflection
474-
| JSONOutput.DeclarationReflection
474+
| JSONOutput.DeclarationReflection,
475475
) {
476476
let formatted = "{ ";
477477
if (declaration.children) {
@@ -487,7 +487,7 @@ export async function getReferenceAPI(repo: string, ref: string) {
487487
}
488488

489489
function formatSignature(
490-
sig: JSONOutput.SignatureReflection | JSONOutput.TypeParameterReflection
490+
sig: JSONOutput.SignatureReflection | JSONOutput.TypeParameterReflection,
491491
) {
492492
switch (sig.kind) {
493493
case ReflectionKind.CallSignature: {
@@ -534,7 +534,7 @@ export async function getReferenceAPI(repo: string, ref: string) {
534534
}
535535

536536
function inlineTagToMarkdown(
537-
inlineTag: JSONOutput.InlineTagDisplayPart
537+
inlineTag: JSONOutput.InlineTagDisplayPart,
538538
): string {
539539
switch (inlineTag.tag) {
540540
case "@link":

0 commit comments

Comments
 (0)