mirror of https://github.com/MaxLeiter/Drift
Update to next 13, switch to pnpm (#127)
* switch to pnpm * dep improvements, style fixes, next/link codemod * server: upgrade sqlitepull/128/head
parent
9771e64f93
commit
55c5ecfe6c
@ -0,0 +1,4 @@
|
||||
{
|
||||
"typescript.tsdk": "./node_modules/typescript/lib",
|
||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
import type { LinkProps } from "@geist-ui/core"
|
||||
import { Link as GeistLink } from "@geist-ui/core"
|
||||
import { useRouter } from "next/router"
|
||||
|
||||
const Link = (props: LinkProps) => {
|
||||
const { basePath } = useRouter()
|
||||
const propHrefWithoutLeadingSlash =
|
||||
props.href && props.href.startsWith("/")
|
||||
? props.href.substring(1)
|
||||
: props.href
|
||||
const href = basePath
|
||||
? `${basePath}/${propHrefWithoutLeadingSlash}`
|
||||
: props.href
|
||||
return <GeistLink {...props} href={href} />
|
||||
}
|
||||
|
||||
export default Link
|
||||
@ -0,0 +1,26 @@
|
||||
import { useRouter } from "next/router"
|
||||
import NextLink from "next/link"
|
||||
import styles from "./link.module.css"
|
||||
|
||||
type LinkProps = {
|
||||
href: string,
|
||||
colored?: boolean,
|
||||
children: React.ReactNode
|
||||
} & React.ComponentProps<typeof NextLink>
|
||||
|
||||
const Link = ({ href, colored, children, ...props }: LinkProps) => {
|
||||
const { basePath } = useRouter()
|
||||
const propHrefWithoutLeadingSlash =
|
||||
href && href.startsWith("/") ? href.substring(1) : href
|
||||
|
||||
const url = basePath ? `${basePath}/${propHrefWithoutLeadingSlash}` : href
|
||||
|
||||
const className = colored ? `${styles.link} ${styles.color}` : styles.link
|
||||
return (
|
||||
<NextLink {...props} href={url} className={className}>
|
||||
{children}
|
||||
</NextLink>
|
||||
)
|
||||
}
|
||||
|
||||
export default Link
|
||||
@ -0,0 +1,12 @@
|
||||
.link {
|
||||
text-decoration: none;
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
.color {
|
||||
color: var(--link);
|
||||
}
|
||||
|
||||
.color:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
import styles from "./note.module.css"
|
||||
|
||||
const Note = ({
|
||||
type = "info",
|
||||
children,
|
||||
...props
|
||||
}: {
|
||||
type: "info" | "warning" | "error"
|
||||
children: React.ReactNode
|
||||
} & React.ComponentProps<"div">) => (
|
||||
<div className={`${styles.note} ${styles[type]}`} {...props}>
|
||||
<strong className={styles.type}>{type}:</strong>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
|
||||
export default Note
|
||||
@ -0,0 +1,27 @@
|
||||
.note {
|
||||
font-size: 0.8em;
|
||||
color: var(--fg);
|
||||
margin: 0;
|
||||
padding: var(--gap);
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
.info {
|
||||
background: var(--gray);
|
||||
}
|
||||
|
||||
.warning {
|
||||
background: #f33;
|
||||
}
|
||||
|
||||
.error {
|
||||
background: red;
|
||||
}
|
||||
|
||||
.type {
|
||||
color: var(--fg);
|
||||
margin-right: 0.5em;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,61 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"plugins": [{ "name": "typescript-plugin-css-modules" }],
|
||||
"target": "es2020",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictBindCallApply": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"noImplicitThis": true,
|
||||
"alwaysStrict": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@components/*": ["components/*"],
|
||||
"@lib/*": ["lib/*"],
|
||||
"@styles/*": ["styles/*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
"compilerOptions": {
|
||||
"plugins": [
|
||||
{
|
||||
"name": "typescript-plugin-css-modules"
|
||||
},
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"target": "es2020",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictBindCallApply": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"noImplicitThis": true,
|
||||
"alwaysStrict": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@components/*": [
|
||||
"components/*"
|
||||
],
|
||||
"@lib/*": [
|
||||
"lib/*"
|
||||
],
|
||||
"@styles/*": [
|
||||
"styles/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue