-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init new docs, major lint/tsconfig refactor (#42)
- Loading branch information
1 parent
981f4d3
commit febb649
Showing
86 changed files
with
4,710 additions
and
461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"docs": patch | ||
"web": patch | ||
--- | ||
|
||
init new docs, major lint/tsconfig refactor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// This configuration only applies to the package manager root. | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ["eslint-config-custom/library.js"], | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint"], | ||
root: true, | ||
parserOptions: { | ||
project: [ | ||
"./tsconfig.json", | ||
"./packages/*/tsconfig.json", | ||
"./apps/*/tsconfig.json", | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
{ | ||
"$schema": "https://typedoc.org/schema.json", | ||
"plugin": ["typedoc-plugin-resolve-external"], | ||
"entryPointStrategy": "resolve", | ||
"categorizeByGroup": true, | ||
"excludeInternal": true, | ||
"externalModulemap": { | ||
"@webgpu/types": "https://gpuweb.github.io/types/" | ||
}, | ||
"exclude": ["**/node_modules/**/*", "**/*.test.ts"], | ||
"logLevel": "Verbose" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
{ | ||
"extends": "./typedoc.base.json", | ||
"$schema": "https://typedoc.org/schema.json", | ||
"extends": ["./typedoc.base.json"], | ||
"name": "webgpu-kit", | ||
"out": "./dist", | ||
"entryPoints": ["../../packages/core/src/*.ts"], | ||
"entryPointStrategy": "resolve", | ||
"categorizeByGroup": true, | ||
"excludeInternal": true, | ||
"exclude": [ | ||
"**/node_modules/**/*", | ||
"**/*.test.ts", | ||
"../../packages/core/src/index.ts" | ||
], | ||
"externalModulemap": { | ||
"@webgpu/types": "https://gpuweb.github.io/types/" | ||
} | ||
"json": "dist/out.json", | ||
"entryPoints": ["../../packages/core/", "../../packages/shaders/"], | ||
"entryPointStrategy": "packages", | ||
"readme": "../../README.md" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ["custom/next"], | ||
root: true, | ||
extends: ["eslint-config-custom/next.js"], | ||
ignorePatterns: ["next.config.js"], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: true, | ||
}, | ||
rules: { | ||
"no-bitwise": "off", | ||
"no-undef": "off", | ||
"no-unsafe-call": "off", | ||
}, | ||
root: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { notFound } from "next/navigation"; | ||
import { allGroups } from "../../reflection-utils"; | ||
import { ClassView } from "./views/class"; | ||
import { FunctionView } from "./views/function"; | ||
import { ModuleView } from "./views/module"; | ||
import { TypeView } from "./views/type"; | ||
|
||
export type ViewParams = { | ||
type: string; | ||
id: string; | ||
}; | ||
|
||
export type View = (props: { params: ViewParams }) => JSX.Element; | ||
|
||
const views: Record<string, View | undefined> = { | ||
classes: ClassView, | ||
modules: ModuleView, | ||
types: TypeView, | ||
functions: FunctionView, | ||
}; | ||
|
||
export default function Page(props: { params: ViewParams }): JSX.Element { | ||
const { type } = props.params; | ||
const View = views[type]; | ||
|
||
if (!View) { | ||
console.error(`No view for type: ${type}`); | ||
notFound(); | ||
} | ||
|
||
return ( | ||
<div> | ||
<View params={props.params} /> | ||
</div> | ||
); | ||
} | ||
|
||
export function generateStaticParams(): ViewParams[] { | ||
return Array.from(allGroups) | ||
.map(([type, ids]) => ids.map((id) => ({ type, id }))) | ||
.flat(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@use "./item.module.scss"; | ||
|
||
main.class { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1.25rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { | ||
getReflectionById, | ||
parseConstructorSignatures, | ||
parseMethodsSignatures, | ||
parseProperties, | ||
} from "@/app/docs/reflection-utils"; | ||
import { ViewParams } from "../page"; | ||
import { CommentContent } from "@/app/docs/components/comment-content"; | ||
import { Signature } from "@/app/docs/components/signature"; | ||
import { Property } from "@/app/docs/components/property"; | ||
import styles from "./class.module.scss"; | ||
import { Item } from "./item"; | ||
|
||
export function ClassView(props: { params: ViewParams }): JSX.Element { | ||
const { id } = props.params; | ||
const reflection = getReflectionById(parseInt(id)); | ||
|
||
if (!reflection) { | ||
throw new Error(`Reflection not found for id: ${id}`); | ||
} | ||
|
||
const { comment } = reflection; | ||
|
||
const ctorSignatures = parseConstructorSignatures(reflection); | ||
const properties = parseProperties(reflection); | ||
const methodSignatures = parseMethodsSignatures(reflection); | ||
|
||
return ( | ||
<main className={styles.class}> | ||
<div> | ||
<h1>{reflection.name}</h1> | ||
{comment !== undefined && <CommentContent comment={comment} />} | ||
</div> | ||
|
||
{ctorSignatures.length > 0 ? ( | ||
<div className={styles.group}> | ||
<h3>Constructors</h3> | ||
|
||
{ctorSignatures.map((signature) => ( | ||
<Item key={signature.id} className={styles.item}> | ||
<Signature signature={signature} /> | ||
</Item> | ||
))} | ||
</div> | ||
) : null} | ||
|
||
{properties.length > 0 ? ( | ||
<div className={styles.group}> | ||
<h3>Properties</h3> | ||
|
||
{properties.map((reflection) => ( | ||
<Item key={reflection.id} className={styles.item}> | ||
<h3>{reflection.name}</h3> | ||
<Property reflection={reflection} /> | ||
</Item> | ||
))} | ||
</div> | ||
) : null} | ||
|
||
{methodSignatures.length > 0 ? ( | ||
<div className={styles.group}> | ||
<h3>Methods</h3> | ||
|
||
{methodSignatures.map((signature) => ( | ||
<Item key={signature.id} className={styles.item}> | ||
<h3>{signature.name}</h3> | ||
<Signature signature={signature} showName /> | ||
</Item> | ||
))} | ||
</div> | ||
) : null} | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@use "./item.module.scss"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { ReflectionKind } from "@/app/docs/reflection-utils"; | ||
import { | ||
getReflectionById, | ||
getReflectionsByKind, | ||
} from "../../../reflection-utils"; | ||
import { Signature } from "../../../components/signature"; | ||
import styles from "./function.module.scss"; | ||
import { Item } from "./item"; | ||
|
||
type Params = { | ||
id: string; | ||
}; | ||
|
||
export function FunctionView(props: { params: Params }): JSX.Element { | ||
const reflection = getReflectionById(parseInt(props.params.id)); | ||
|
||
if (reflection === undefined) { | ||
throw new Error(`Reflection not found for id: ${props.params.id}`); | ||
} | ||
|
||
const signatures = reflection.signatures || []; | ||
|
||
return ( | ||
<div className={styles.group}> | ||
<h1>{reflection.name}</h1> | ||
|
||
{signatures.map((signature) => ( | ||
<Item key={signature.id} className={styles.item}> | ||
<Signature signature={signature} /> | ||
</Item> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export function generateStaticParams(): Params[] { | ||
return getReflectionsByKind(ReflectionKind.Module).map((reflection) => ({ | ||
id: reflection.id.toString(), | ||
})); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.group { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.item { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
|
||
border-left: solid 1px #333; | ||
padding-left: 1rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import styles from "./item.module.scss"; | ||
|
||
export function Item(props: JSX.IntrinsicElements["div"]): JSX.Element { | ||
const { className, ...rest } = props; | ||
|
||
const classes = `${className} ${styles.item}`; | ||
|
||
return <div className={classes} {...rest} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.module { | ||
padding-top: 1rem; | ||
|
||
h1 { | ||
font-size: 2.5rem; | ||
} | ||
|
||
.group { | ||
margin: 1.5rem 0; | ||
|
||
a { | ||
color: inherit; | ||
text-decoration: none; | ||
} | ||
|
||
.groupItem { | ||
display: flex; | ||
align-items: center; | ||
margin: 0.5rem 0; | ||
gap: 0.5rem; | ||
} | ||
|
||
h2 { | ||
font-size: 1.85rem; | ||
} | ||
|
||
h3 { | ||
opacity: 0.8; | ||
font-weight: 400; | ||
} | ||
|
||
h4 { | ||
font-size: 0.8rem; | ||
font-weight: 400; | ||
color: white; | ||
border: 1px solid #555; | ||
border-radius: 10px; | ||
padding: 0.25em 0.5em; | ||
} | ||
} | ||
} |
Oops, something went wrong.