diff --git a/.changeset/lovely-kiwis-speak.md b/.changeset/lovely-kiwis-speak.md new file mode 100644 index 0000000..01d9eed --- /dev/null +++ b/.changeset/lovely-kiwis-speak.md @@ -0,0 +1,5 @@ +--- +"next-static-paths": patch +--- + +add a readme to the npm package diff --git a/README.md b/README.md index 8016e69..918506b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Statically prevent HTTP 404 Not Found in your Next.js applications using TypeScr 🔗 A `` component which wraps Next.js `` and provides type-safe path matching -📝 A `urlFor` helper that enables path generation in a type-safe manner +📝 A `pathFor` helper that enables path generation in a type-safe manner ## Usage diff --git a/packages/next-static-paths/README.md b/packages/next-static-paths/README.md new file mode 100644 index 0000000..328a595 --- /dev/null +++ b/packages/next-static-paths/README.md @@ -0,0 +1,49 @@ +# `next-static-paths` + +Statically prevent HTTP 404 Not Found in your Next.js applications using TypeScript and code generation. + +## Usage + +```sh-session +$ pnpm add next-static-paths +# or +$ yarn add next-static-paths +# or +$ npm install next-static-paths +``` + +Then, from within your Next.js application root, run the following command: + +```sh-session +# For pnpm users +$ pnpx next-static-paths + +# For yarn users +$ yarn next-static-paths + +# For npm users +$ npx next-static-paths +``` + +### `TypedLink` component + +```tsx +import { TypedLink } from "next-static-paths"; +function MyComponent() { + return ( + + Hello world + + ); +} +``` + +### `pathFor` helper + +```tsx +import { pathFor } from "next-static-paths"; + +function getPath() { + return pathFor("/some/[myArgument]", { myArgument: "hello world" }); +} +```