Merged in chore/typegen-nextjs-routes (pull request #3147)
Make check-types dependent on next typegen * add typegen as a prestep Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
"lint": "next lint --max-warnings 0 && tsgo --noEmit",
|
"lint": "next lint --max-warnings 0 && tsgo --noEmit",
|
||||||
"lint:fix": "next lint --fix && tsgo --noEmit",
|
"lint:fix": "next lint --fix && tsgo --noEmit",
|
||||||
"check-types": "tsgo --noEmit",
|
"check-types": "tsgo --noEmit",
|
||||||
|
"typegen": "next typegen",
|
||||||
"clean": "rm -rf .next",
|
"clean": "rm -rf .next",
|
||||||
"test": "vitest run --passWithNoTests",
|
"test": "vitest run --passWithNoTests",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
"clean": {
|
"clean": {
|
||||||
"cache": false
|
"cache": false
|
||||||
},
|
},
|
||||||
|
"typegen": { "dependsOn": [] },
|
||||||
|
"check-types": { "dependsOn": ["typegen"] },
|
||||||
"include:shared": {
|
"include:shared": {
|
||||||
"outputs": ["public/_static/shared/**"]
|
"outputs": ["public/_static/shared/**"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import styles from "./layout.module.css"
|
import styles from "./layout.module.css"
|
||||||
|
|
||||||
import type { LayoutProps } from "@/.next/types/app/[lang]/(live)/(public)/(contentTypes)/layout"
|
// Unable to use LayoutProps directly, probably due to parallel routes and/or page groups
|
||||||
|
type Props = Pick<
|
||||||
export default function ContentTypeLayout(props: LayoutProps) {
|
LayoutProps<"/[lang]">,
|
||||||
|
"children" | "preview" | "breadcrumbs"
|
||||||
|
>
|
||||||
|
export default function ContentTypeLayout(props: Props) {
|
||||||
return (
|
return (
|
||||||
<section className={styles.layout}>
|
<section className={styles.layout}>
|
||||||
{props.preview}
|
{props.preview}
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ import { getMessages } from "@/i18n"
|
|||||||
import ClientIntlProvider from "@/i18n/Provider"
|
import ClientIntlProvider from "@/i18n/Provider"
|
||||||
import { setLang } from "@/i18n/serverContext"
|
import { setLang } from "@/i18n/serverContext"
|
||||||
|
|
||||||
import type { LayoutProps } from "@/.next/types/app/[lang]/(no-layout)/layout"
|
// Unable to use LayoutProps directly, probably due to parallel routes
|
||||||
|
type Props = Pick<LayoutProps<"/[lang]">, "children" | "params">
|
||||||
export default async function RootLayout(props: LayoutProps) {
|
export default async function RootLayout(props: Props) {
|
||||||
const params = await props.params
|
const params = await props.params
|
||||||
|
|
||||||
const { children } = props
|
const { children } = props
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
"ci:build": "yarn lint && yarn test && yarn build",
|
"ci:build": "yarn lint && yarn test && yarn build",
|
||||||
"clean": "rm -rf .next",
|
"clean": "rm -rf .next",
|
||||||
"check-types": "tsgo --noEmit",
|
"check-types": "tsgo --noEmit",
|
||||||
|
"typegen": "next typegen",
|
||||||
"include:shared": "jiti ../../scripts/copyFiles.ts ../../shared public/_static/shared",
|
"include:shared": "jiti ../../scripts/copyFiles.ts ../../shared public/_static/shared",
|
||||||
"format": "prettier --write ."
|
"format": "prettier --write ."
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
"include:shared": {
|
"include:shared": {
|
||||||
"outputs": ["public/_static/shared/**"]
|
"outputs": ["public/_static/shared/**"]
|
||||||
},
|
},
|
||||||
|
"typegen": { "dependsOn": [] },
|
||||||
|
"check-types": { "dependsOn": ["typegen"] },
|
||||||
"clean": {
|
"clean": {
|
||||||
"cache": false
|
"cache": false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user