diff --git a/.changeset/config.json b/.changeset/config.json index d66c0aa..2f16bf1 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,5 +7,5 @@ "commit": false, "access": "public", "baseBranch": "main", - "ignore": ["pagesdir", "appdir"] + "ignore": ["pagesdir", "appdir", "custom-filename"] } diff --git a/.changeset/little-mirrors-count.md b/.changeset/little-mirrors-count.md new file mode 100644 index 0000000..fb4b345 --- /dev/null +++ b/.changeset/little-mirrors-count.md @@ -0,0 +1,5 @@ +--- +"next-typesafe-url": minor +--- + +updates the cli to allow for a custom filename to be set under the --filename flag to replace the default of 'routeType.ts' - Thank you @JasonPaff ! diff --git a/examples/custom-filename/.eslintrc.json b/examples/custom-filename/.eslintrc.json new file mode 100644 index 0000000..bffb357 --- /dev/null +++ b/examples/custom-filename/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/examples/custom-filename/.gitignore b/examples/custom-filename/.gitignore new file mode 100644 index 0000000..8f322f0 --- /dev/null +++ b/examples/custom-filename/.gitignore @@ -0,0 +1,35 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/examples/custom-filename/README.md b/examples/custom-filename/README.md new file mode 100644 index 0000000..f4da3c4 --- /dev/null +++ b/examples/custom-filename/README.md @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/custom-filename/_next-typesafe-url_.d.ts b/examples/custom-filename/_next-typesafe-url_.d.ts new file mode 100644 index 0000000..8174469 --- /dev/null +++ b/examples/custom-filename/_next-typesafe-url_.d.ts @@ -0,0 +1,18 @@ +// This file is generated by next-typesafe-url +// Do not edit this file directly. + +// @generated +// prettier-ignore +/* eslint-disable */ + +declare module "@@@next-typesafe-url" { + import type { InferRoute, StaticRoute } from "next-typesafe-url"; + + interface DynamicRouter { + "/[slug]/[...foo]": InferRoute; + } + + interface StaticRouter { + "/": StaticRoute; + } +} diff --git a/examples/custom-filename/next.config.js b/examples/custom-filename/next.config.js new file mode 100644 index 0000000..a1d8164 --- /dev/null +++ b/examples/custom-filename/next.config.js @@ -0,0 +1,12 @@ +const withMDX = require('@next/mdx')() + + +/** @type {import('next').NextConfig} */ +const nextConfig = { + pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'], + experimental: { + appDir: true, + }, +} + +module.exports = withMDX(nextConfig) diff --git a/examples/custom-filename/package.json b/examples/custom-filename/package.json new file mode 100644 index 0000000..b2353e8 --- /dev/null +++ b/examples/custom-filename/package.json @@ -0,0 +1,31 @@ +{ + "name": "custom-filename", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "concurrently \"next-typesafe-url -w --filename route-type --pageExtensions js,jsx,mdx,ts,tsx\" \"next dev\"", + "build": "next-typesafe-url --filename route-type --pageExtensions js,jsx,mdx,ts,tsx && next build", + "start": "next start" + }, + "dependencies": { + "@mdx-js/loader": "^3.0.1", + "@mdx-js/react": "^3.0.1", + "@next/mdx": "^14.2.4", + "@types/mdx": "^2.0.13", + "@types/node": "18.16.3", + "@types/react": "18.2.5", + "@types/react-dom": "18.2.3", + "autoprefixer": "10.4.14", + "concurrently": "^8.0.1", + "eslint": "8.39.0", + "eslint-config-next": "13.4.0", + "next": "13.4.12", + "next-typesafe-url": "workspace:*", + "postcss": "8.4.23", + "react": "18.2.0", + "react-dom": "18.2.0", + "tailwindcss": "3.3.2", + "typescript": "5.0.4", + "zod": "^3.20.2" + } +} diff --git a/examples/custom-filename/postcss.config.js b/examples/custom-filename/postcss.config.js new file mode 100644 index 0000000..33ad091 --- /dev/null +++ b/examples/custom-filename/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/examples/custom-filename/public/next.svg b/examples/custom-filename/public/next.svg new file mode 100644 index 0000000..5174b28 --- /dev/null +++ b/examples/custom-filename/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/custom-filename/public/vercel.svg b/examples/custom-filename/public/vercel.svg new file mode 100644 index 0000000..d2f8422 --- /dev/null +++ b/examples/custom-filename/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/custom-filename/src/app/[slug]/[...foo]/client.tsx b/examples/custom-filename/src/app/[slug]/[...foo]/client.tsx new file mode 100644 index 0000000..294b804 --- /dev/null +++ b/examples/custom-filename/src/app/[slug]/[...foo]/client.tsx @@ -0,0 +1,45 @@ +"use client"; + +import { $path } from "next-typesafe-url"; +import Link from "next/link"; +import { useState } from "react"; +import { useRouteParams, useSearchParams } from "next-typesafe-url/app"; +import { Route } from "./route-type"; +import { useParams } from "next/navigation"; + +export const Client = () => { + const [input, setInput] = useState(""); + const nextParams = useParams(); + console.log("nextParams", nextParams); + + const params = useSearchParams(Route.searchParams); + const routeParams = useRouteParams(Route.routeParams); + + return ( + <> + Back +
+ setInput(e.target.value)} /> + + hooks + +
+

searchParams

+
{`data: ${JSON.stringify(params)}`}
+

routeParams

+
{`data: ${JSON.stringify(routeParams)}`}
+ + ); +}; diff --git a/examples/custom-filename/src/app/[slug]/[...foo]/error.tsx b/examples/custom-filename/src/app/[slug]/[...foo]/error.tsx new file mode 100644 index 0000000..ce57962 --- /dev/null +++ b/examples/custom-filename/src/app/[slug]/[...foo]/error.tsx @@ -0,0 +1,30 @@ +"use client"; // Error components must be Client components + +import { useEffect } from "react"; + +export default function Error({ + error, + reset, +}: { + error: Error; + reset: () => void; +}) { + useEffect(() => { + // Log the error to an error reporting service + console.error(error); + }, [error]); + + return ( +
+

Something went wrong!

+ +
+ ); +} diff --git a/examples/custom-filename/src/app/[slug]/[...foo]/page.tsx b/examples/custom-filename/src/app/[slug]/[...foo]/page.tsx new file mode 100644 index 0000000..948c2bd --- /dev/null +++ b/examples/custom-filename/src/app/[slug]/[...foo]/page.tsx @@ -0,0 +1,25 @@ +import { withParamValidation } from "next-typesafe-url/app/hoc"; +import { InferPagePropsType } from "next-typesafe-url"; +import { Route, RouteType } from "./route-type"; +import { Client } from "./client"; + +type PageProps = InferPagePropsType; + +let count = 0; + +const Page = ({ routeParams, searchParams }: PageProps) => { + console.log("render", count++); + console.log(JSON.stringify(routeParams)); + console.log(JSON.stringify(searchParams)); + + return ( + <> +
{`data: ${JSON.stringify(routeParams)}`}
+
+
{`data: ${JSON.stringify(searchParams)}`}
+ + + ); +}; + +export default withParamValidation(Page, Route); diff --git a/examples/custom-filename/src/app/[slug]/[...foo]/route-type.ts b/examples/custom-filename/src/app/[slug]/[...foo]/route-type.ts new file mode 100644 index 0000000..beddb40 --- /dev/null +++ b/examples/custom-filename/src/app/[slug]/[...foo]/route-type.ts @@ -0,0 +1,20 @@ +import { z } from "zod"; +import { type DynamicRoute } from "next-typesafe-url"; + +export const Route = { + routeParams: z.object({ + slug: z.string(), + foo: z.array(z.number()).or(z.number()), + }), + searchParams: z.object({ + location: z.enum(["us", "eu"]).optional(), + userInfo: z + .object({ + name: z.string(), + age: z.number(), + }) + .optional(), + }), +} satisfies DynamicRoute; + +export type RouteType = typeof Route; diff --git a/examples/custom-filename/src/app/[slug]/layout.tsx b/examples/custom-filename/src/app/[slug]/layout.tsx new file mode 100644 index 0000000..3aec9ad --- /dev/null +++ b/examples/custom-filename/src/app/[slug]/layout.tsx @@ -0,0 +1,24 @@ +import { z } from "zod"; +import { withLayoutParamValidation } from "next-typesafe-url/app/hoc"; +import type { DynamicLayout, InferLayoutPropsType } from "next-typesafe-url"; + +const LayoutRoute = { + routeParams: z.object({ + slug: z.string(), + }), +} satisfies DynamicLayout; +type LayoutType = typeof LayoutRoute; + +type Props = InferLayoutPropsType; +function Layout({ children, routeParams }: Props) { + return ( +
+

THIS IS A LAYOUT

+

{JSON.stringify(routeParams)}

+
{children}
+

bottom

+
+ ); +} + +export default withLayoutParamValidation(Layout, LayoutRoute); diff --git a/examples/custom-filename/src/app/favicon.ico b/examples/custom-filename/src/app/favicon.ico new file mode 100644 index 0000000..718d6fe Binary files /dev/null and b/examples/custom-filename/src/app/favicon.ico differ diff --git a/examples/custom-filename/src/app/globals.css b/examples/custom-filename/src/app/globals.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/examples/custom-filename/src/app/globals.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/examples/custom-filename/src/app/layout.tsx b/examples/custom-filename/src/app/layout.tsx new file mode 100644 index 0000000..415037d --- /dev/null +++ b/examples/custom-filename/src/app/layout.tsx @@ -0,0 +1,21 @@ +import { Inter } from "next/font/google"; +import "./globals.css"; + +const inter = Inter({ subsets: ["latin"] }); + +export const metadata = { + title: "Create Next App", + description: "Generated by create next app", +}; + +export default function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + + {children} + + ); +} diff --git a/examples/custom-filename/src/app/page.tsx b/examples/custom-filename/src/app/page.tsx new file mode 100644 index 0000000..59acc48 --- /dev/null +++ b/examples/custom-filename/src/app/page.tsx @@ -0,0 +1,26 @@ +"use client"; + +import { $path, type RouterOutputs } from "next-typesafe-url"; +import Link from "next/link"; + +type _ThisIsHelpful = RouterOutputs["/[slug]/[...foo]"]["routeParams"]; + +export default function Page() { + return ( + <> +
test
+ + server component! + + + ); +} diff --git a/examples/custom-filename/src/mdx-components.tsx b/examples/custom-filename/src/mdx-components.tsx new file mode 100644 index 0000000..9ff7229 --- /dev/null +++ b/examples/custom-filename/src/mdx-components.tsx @@ -0,0 +1,7 @@ +import type { MDXComponents } from "mdx/types"; + +export function useMDXComponents(components: MDXComponents): MDXComponents { + return { + ...components, + }; +} diff --git a/examples/custom-filename/tailwind.config.js b/examples/custom-filename/tailwind.config.js new file mode 100644 index 0000000..d53b2ea --- /dev/null +++ b/examples/custom-filename/tailwind.config.js @@ -0,0 +1,18 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + './src/pages/**/*.{js,ts,jsx,tsx,mdx}', + './src/components/**/*.{js,ts,jsx,tsx,mdx}', + './src/app/**/*.{js,ts,jsx,tsx,mdx}', + ], + theme: { + extend: { + backgroundImage: { + 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', + 'gradient-conic': + 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', + }, + }, + }, + plugins: [], +} diff --git a/examples/custom-filename/tsconfig.json b/examples/custom-filename/tsconfig.json new file mode 100644 index 0000000..0c7555f --- /dev/null +++ b/examples/custom-filename/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": ["./src/*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/packages/next-typesafe-url/src/cli.ts b/packages/next-typesafe-url/src/cli.ts index 55395ff..dae3d66 100644 --- a/packages/next-typesafe-url/src/cli.ts +++ b/packages/next-typesafe-url/src/cli.ts @@ -18,6 +18,7 @@ Options: --srcPath, The path to your src directory relative to the cwd the cli is run from. DEFAULT: "./src" --outputPath, The path of the generated .d.ts file relative to the cwd the cli is run from. DEFAULT: "./_next-typesafe-url_.d.ts" --pageExtensions, A comma separated list of file extensions to consider as. DEFAULT: "tsx,ts,jsx,js" +--filename, Override the default name of the RouteType file in the app directory. DEFAULT: "routeType.ts" --help, Show this help message `; @@ -39,6 +40,10 @@ const cli = meow(helpText, { type: "string", default: "tsx,ts,jsx,js", }, + filename: { + type: "string", + default: "routeType", + }, }, }); @@ -57,9 +62,11 @@ export type RouteInformation = { function build({ paths, pageExtensions, + filename, }: { paths: Paths; pageExtensions: string[]; + filename: string; }) { const { absoluteAppPath, absolutePagesPath } = paths; @@ -68,6 +75,7 @@ function build({ basePath: absoluteAppPath, dir: absoluteAppPath, pageExtensions, + filename, }) : null; const pagesRoutesInfo = absolutePagesPath @@ -75,6 +83,7 @@ function build({ basePath: absolutePagesPath, dir: absolutePagesPath, pageExtensions, + filename, }) : null; @@ -82,6 +91,7 @@ function build({ appRoutesInfo, pagesRoutesInfo, paths, + filename, }); console.log(`Generated route types`); } @@ -89,9 +99,11 @@ function build({ function watch({ paths, pageExtensions, + filename, }: { paths: Paths; pageExtensions: string[]; + filename: string; }) { const { absoluteAppPath, absolutePagesPath } = paths; @@ -99,14 +111,14 @@ function watch({ chokidar .watch([`${absoluteAppPath}/**/*.{${pageExtensions.join(",")}}`]) .on("change", () => { - build({ paths, pageExtensions }); + build({ filename, paths, pageExtensions }); }); } if (absolutePagesPath) { chokidar .watch([`${absolutePagesPath}/**/*.{${pageExtensions.join(",")}}`]) .on("change", () => { - build({ paths, pageExtensions }); + build({ filename, paths, pageExtensions }); }); } @@ -114,7 +126,7 @@ function watch({ } if (require.main === module) { - const { srcPath, outputPath } = cli.flags; + const { filename, srcPath, outputPath } = cli.flags; const pageExtensions = cli.flags.pageExtensions.split(","); const absoluteSrcPath = path.join(process.cwd(), srcPath); @@ -144,10 +156,10 @@ if (require.main === module) { }; if (cli.flags.watch) { - build({ paths, pageExtensions }); - watch({ paths, pageExtensions }); + build({ filename, paths, pageExtensions }); + watch({ filename, paths, pageExtensions }); } else { - build({ paths, pageExtensions }); + build({ filename, paths, pageExtensions }); } } diff --git a/packages/next-typesafe-url/src/generateTypes.ts b/packages/next-typesafe-url/src/generateTypes.ts index 80f1dab..f924fcc 100644 --- a/packages/next-typesafe-url/src/generateTypes.ts +++ b/packages/next-typesafe-url/src/generateTypes.ts @@ -8,12 +8,14 @@ export function getPAGESRoutesWithExportedRoute({ hasRoute = [], doesntHaveRoute = [], pageExtensions, + filename, }: { basePath: string; dir: string; hasRoute?: string[]; doesntHaveRoute?: string[]; pageExtensions: string[]; + filename: string; }): RouteInformation { fs.readdirSync(dir).forEach((file) => { const fullPath = path.join(dir, file); @@ -24,6 +26,7 @@ export function getPAGESRoutesWithExportedRoute({ hasRoute, doesntHaveRoute, pageExtensions, + filename, }); } else { const fileName = path.basename(fullPath); @@ -76,12 +79,14 @@ export function getAPPRoutesWithExportedRoute({ hasRoute = [], doesntHaveRoute = [], pageExtensions, + filename, }: { basePath: string; dir: string; hasRoute?: string[]; doesntHaveRoute?: string[]; pageExtensions: string[]; + filename: string; }): RouteInformation { fs.readdirSync(dir).forEach((file) => { const fullPath = path.join(dir, file); @@ -107,6 +112,7 @@ export function getAPPRoutesWithExportedRoute({ hasRoute, doesntHaveRoute, pageExtensions, + filename, }); } else if ( // Matches page files with the extensions from pageExtensions @@ -123,7 +129,7 @@ export function getAPPRoutesWithExportedRoute({ } const routeTypePaths = ["ts", "tsx"].map((ext) => - path.join(dir, `routeType.${ext}`), + path.join(dir, `${filename}.${ext}`), ); const didAddRoute = routeTypePaths.reduce((didAdd, routeTypePath) => { // Avoid adding the same route twice @@ -150,10 +156,12 @@ export function generateTypesFile({ appRoutesInfo, pagesRoutesInfo, paths, + filename, }: { appRoutesInfo: RouteInformation | null; pagesRoutesInfo: RouteInformation | null; paths: Paths; + filename: string; }): void { let routeCounter = 0; @@ -172,7 +180,7 @@ export function generateTypesFile({ const pathAfterSrc = path.join( type, route === "/" ? "" : route, - type === "app" ? "routeType" : "", + type === "app" ? filename : "", ); const finalRelativePath = path .join(paths.relativePathFromOutputToSrc, pathAfterSrc) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7871103..1253bb4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: '@typescript-eslint/eslint-plugin': 5.62.0_575p57tkdo2rnomrmwebxr67lm '@typescript-eslint/parser': 5.62.0_6vi2gkvwlfwgplg2hmgmdmjnte eslint: 8.39.0 - prettier: 3.3.3 - turbo: 2.2.3 + prettier: 3.4.2 + turbo: 2.3.3 typescript: 5.1.3 vitest: 0.32.4 devDependencies: @@ -75,6 +75,48 @@ importers: webpack: 5.95.0 zod: 3.21.4 + examples/custom-filename: + specifiers: + '@mdx-js/loader': ^3.0.1 + '@mdx-js/react': ^3.0.1 + '@next/mdx': ^14.2.4 + '@types/mdx': ^2.0.13 + '@types/node': 18.16.3 + '@types/react': 18.2.5 + '@types/react-dom': 18.2.3 + autoprefixer: 10.4.14 + concurrently: ^8.0.1 + eslint: 8.39.0 + eslint-config-next: 13.4.0 + next: 13.4.12 + next-typesafe-url: workspace:* + postcss: 8.4.23 + react: 18.2.0 + react-dom: 18.2.0 + tailwindcss: 3.3.2 + typescript: 5.0.4 + zod: ^3.20.2 + dependencies: + '@mdx-js/loader': 3.1.0 + '@mdx-js/react': 3.1.0_3pi6y6cylzraaxxtldk4o6b3zi + '@next/mdx': 14.2.16_pk7en4hfcut6yramuy54dinnoe + '@types/mdx': 2.0.13 + '@types/node': 18.16.3 + '@types/react': 18.2.5 + '@types/react-dom': 18.2.3 + autoprefixer: 10.4.14_postcss@8.4.23 + concurrently: 8.2.2 + eslint: 8.39.0 + eslint-config-next: 13.4.0_iacogk7kkaymxepzhgcbytyi7q + next: 13.4.12_biqbaboplfbrettd7655fr4n2y + next-typesafe-url: link:../../packages/next-typesafe-url + postcss: 8.4.23 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + tailwindcss: 3.3.2 + typescript: 5.0.4 + zod: 3.21.4 + examples/pagesdir: specifiers: '@types/node': 18.16.3 @@ -1647,6 +1689,21 @@ packages: js-yaml: 4.1.0 dev: false + /@mdx-js/loader/3.1.0: + resolution: {integrity: sha512-xU/lwKdOyfXtQGqn3VnJjlDrmKXEvMi1mgYxVmukEUtVycIz1nh7oQ40bKTd4cA7rLStqu0740pnhGYxGoqsCg==} + peerDependencies: + webpack: '>=5' + peerDependenciesMeta: + webpack: + optional: true + dependencies: + '@mdx-js/mdx': 3.1.0 + source-map: 0.7.4 + transitivePeerDependencies: + - acorn + - supports-color + dev: false + /@mdx-js/loader/3.1.0_webpack@5.95.0: resolution: {integrity: sha512-xU/lwKdOyfXtQGqn3VnJjlDrmKXEvMi1mgYxVmukEUtVycIz1nh7oQ40bKTd4cA7rLStqu0740pnhGYxGoqsCg==} peerDependencies: @@ -1695,6 +1752,17 @@ packages: - supports-color dev: false + /@mdx-js/react/3.1.0_3pi6y6cylzraaxxtldk4o6b3zi: + resolution: {integrity: sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==} + peerDependencies: + '@types/react': '>=16' + react: '>=16' + dependencies: + '@types/mdx': 2.0.13 + '@types/react': 18.2.5 + react: 18.2.0 + dev: false + /@mdx-js/react/3.1.0_ys4gee5prganpqdv5owctblfm4: resolution: {integrity: sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==} peerDependencies: @@ -1712,7 +1780,6 @@ packages: /@next/env/13.4.12: resolution: {integrity: sha512-RmHanbV21saP/6OEPBJ7yJMuys68cIf8OBBWd7+uj40LdpmswVAwe1uzeuFyUsd6SfeITWT3XnQfn6wULeKwDQ==} - dev: true /@next/env/15.0.3-canary.1: resolution: {integrity: sha512-J1A96XoPn7rRrElWW6dkiAyb4HVDQ7MB/evf4opEHeYPOo7JX2S5KpG1zjvU0VOJIaOX2yQTQzdbYEsXIQYWLA==} @@ -1755,7 +1822,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@next/swc-darwin-arm64/15.0.3-canary.1: @@ -1782,7 +1848,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@next/swc-darwin-x64/15.0.3-canary.1: @@ -1809,7 +1874,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@next/swc-linux-arm64-gnu/15.0.3-canary.1: @@ -1836,7 +1900,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@next/swc-linux-arm64-musl/15.0.3-canary.1: @@ -1863,7 +1926,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@next/swc-linux-x64-gnu/15.0.3-canary.1: @@ -1890,7 +1952,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@next/swc-linux-x64-musl/15.0.3-canary.1: @@ -1917,7 +1978,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@next/swc-win32-arm64-msvc/15.0.3-canary.1: @@ -1944,7 +2004,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@next/swc-win32-x64-msvc/13.4.0: @@ -1962,7 +2021,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@next/swc-win32-x64-msvc/15.0.3-canary.1: @@ -6722,7 +6780,6 @@ packages: transitivePeerDependencies: - '@babel/core' - babel-plugin-macros - dev: true /next/15.0.3-canary.1_biqbaboplfbrettd7655fr4n2y: resolution: {integrity: sha512-R4k/Bm58HrBlXFuXfuvo7sFk4f0TfRdqpzmO0oJeqJUrYP7KO/f8RFYihq0hu8OD+ePvNx+RzsxOfzxCbmX5LQ==} @@ -7361,8 +7418,8 @@ packages: hasBin: true dev: false - /prettier/3.3.3: - resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + /prettier/3.4.2: + resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} engines: {node: '>=14'} hasBin: true dev: false @@ -8671,64 +8728,64 @@ packages: typescript: 5.1.3 dev: false - /turbo-darwin-64/2.2.3: - resolution: {integrity: sha512-Rcm10CuMKQGcdIBS3R/9PMeuYnv6beYIHqfZFeKWVYEWH69sauj4INs83zKMTUiZJ3/hWGZ4jet9AOwhsssLyg==} + /turbo-darwin-64/2.3.3: + resolution: {integrity: sha512-bxX82xe6du/3rPmm4aCC5RdEilIN99VUld4HkFQuw+mvFg6darNBuQxyWSHZTtc25XgYjQrjsV05888w1grpaA==} cpu: [x64] os: [darwin] requiresBuild: true dev: false optional: true - /turbo-darwin-arm64/2.2.3: - resolution: {integrity: sha512-+EIMHkuLFqUdJYsA3roj66t9+9IciCajgj+DVek+QezEdOJKcRxlvDOS2BUaeN8kEzVSsNiAGnoysFWYw4K0HA==} + /turbo-darwin-arm64/2.3.3: + resolution: {integrity: sha512-DYbQwa3NsAuWkCUYVzfOUBbSUBVQzH5HWUFy2Kgi3fGjIWVZOFk86ss+xsWu//rlEAfYwEmopigsPYSmW4X15A==} cpu: [arm64] os: [darwin] requiresBuild: true dev: false optional: true - /turbo-linux-64/2.2.3: - resolution: {integrity: sha512-UBhJCYnqtaeOBQLmLo8BAisWbc9v9daL9G8upLR+XGj6vuN/Nz6qUAhverN4Pyej1g4Nt1BhROnj6GLOPYyqxQ==} + /turbo-linux-64/2.3.3: + resolution: {integrity: sha512-eHj9OIB0dFaP6BxB88jSuaCLsOQSYWBgmhy2ErCu6D2GG6xW3b6e2UWHl/1Ho9FsTg4uVgo4DB9wGsKa5erjUA==} cpu: [x64] os: [linux] requiresBuild: true dev: false optional: true - /turbo-linux-arm64/2.2.3: - resolution: {integrity: sha512-hJYT9dN06XCQ3jBka/EWvvAETnHRs3xuO/rb5bESmDfG+d9yQjeTMlhRXKrr4eyIMt6cLDt1LBfyi+6CQ+VAwQ==} + /turbo-linux-arm64/2.3.3: + resolution: {integrity: sha512-NmDE/NjZoDj1UWBhMtOPmqFLEBKhzGS61KObfrDEbXvU3lekwHeoPvAMfcovzswzch+kN2DrtbNIlz+/rp8OCg==} cpu: [arm64] os: [linux] requiresBuild: true dev: false optional: true - /turbo-windows-64/2.2.3: - resolution: {integrity: sha512-NPrjacrZypMBF31b4HE4ROg4P3nhMBPHKS5WTpMwf7wydZ8uvdEHpESVNMOtqhlp857zbnKYgP+yJF30H3N2dQ==} + /turbo-windows-64/2.3.3: + resolution: {integrity: sha512-O2+BS4QqjK3dOERscXqv7N2GXNcqHr9hXumkMxDj/oGx9oCatIwnnwx34UmzodloSnJpgSqjl8iRWiY65SmYoQ==} cpu: [x64] os: [win32] requiresBuild: true dev: false optional: true - /turbo-windows-arm64/2.2.3: - resolution: {integrity: sha512-fnNrYBCqn6zgKPKLHu4sOkihBI/+0oYFr075duRxqUZ+1aLWTAGfHZLgjVeLh3zR37CVzuerGIPWAEkNhkWEIw==} + /turbo-windows-arm64/2.3.3: + resolution: {integrity: sha512-dW4ZK1r6XLPNYLIKjC4o87HxYidtRRcBeo/hZ9Wng2XM/MqqYkAyzJXJGgRMsc0MMEN9z4+ZIfnSNBrA0b08ag==} cpu: [arm64] os: [win32] requiresBuild: true dev: false optional: true - /turbo/2.2.3: - resolution: {integrity: sha512-5lDvSqIxCYJ/BAd6rQGK/AzFRhBkbu4JHVMLmGh/hCb7U3CqSnr5Tjwfy9vc+/5wG2DJ6wttgAaA7MoCgvBKZQ==} + /turbo/2.3.3: + resolution: {integrity: sha512-DUHWQAcC8BTiUZDRzAYGvpSpGLiaOQPfYXlCieQbwUvmml/LRGIe3raKdrOPOoiX0DYlzxs2nH6BoWJoZrj8hA==} hasBin: true optionalDependencies: - turbo-darwin-64: 2.2.3 - turbo-darwin-arm64: 2.2.3 - turbo-linux-64: 2.2.3 - turbo-linux-arm64: 2.2.3 - turbo-windows-64: 2.2.3 - turbo-windows-arm64: 2.2.3 + turbo-darwin-64: 2.3.3 + turbo-darwin-arm64: 2.3.3 + turbo-linux-64: 2.3.3 + turbo-linux-arm64: 2.3.3 + turbo-windows-64: 2.3.3 + turbo-windows-arm64: 2.3.3 dev: false /type-check/0.4.0: @@ -9294,7 +9351,6 @@ packages: dependencies: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - dev: true /watchpack/2.4.2: resolution: {integrity: sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==} diff --git a/www/docs/src/content/docs/en/setup/running-the-cli.md b/www/docs/src/content/docs/en/setup/running-the-cli.md index e73b2c2..05ea732 100644 --- a/www/docs/src/content/docs/en/setup/running-the-cli.md +++ b/www/docs/src/content/docs/en/setup/running-the-cli.md @@ -46,6 +46,10 @@ The path to your `src` directory relative to the cwd the cli is run from. DEFAUL The path of the generated `.d.ts` file relative to the cwd the cli is run from. DEFAULT: `"./next-typesafe-url_.d.ts"` +#### --filename + +Override the default filename for the `routeType.ts` file in the app directory. DEFAULT: `routeType` + #### --help Show this information