From decd6c99be54fe6fd0255a6d1cbf8ade60653673 Mon Sep 17 00:00:00 2001 From: Ethan Niser <100045248+ethanniser@users.noreply.github.com> Date: Thu, 16 Mar 2023 15:30:33 +0000 Subject: [PATCH 1/4] docs add ts plugin todo and clarify pages dir --- .changeset/neat-garlics-wash.md | 5 +++++ README.md | 3 ++- package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/neat-garlics-wash.md diff --git a/.changeset/neat-garlics-wash.md b/.changeset/neat-garlics-wash.md new file mode 100644 index 0000000..83881ee --- /dev/null +++ b/.changeset/neat-garlics-wash.md @@ -0,0 +1,5 @@ +--- +"next-typesafe-url": patch +--- + +docs: clarify app router, add todo ts plugin, and clarify pages dir only in package desc diff --git a/README.md b/README.md index 92d2e2b..748383a 100644 --- a/README.md +++ b/README.md @@ -257,4 +257,5 @@ type ProductIDRouteParams = AppRouter["/product/[productID]"]["routeParams"]; # TODO - add tests -- `app` directory support +- `app` router support +- [`remix-routes` style typescript plugin](https://github.com/yesmeck/remix-routes/tree/master/packages/typescript-remix-routes-plugin) to improve autocomplete and add 'go to definition' to route string (would take you to the route file) diff --git a/package.json b/package.json index ad5caa7..82a9bb7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "next-typesafe-url", - "description": "JSON serializable, fully typesafe, and zod validated URL search params, dynamic route params, and routing for NextJS", + "description": "JSON serializable, fully typesafe, and zod validated URL search params, dynamic route params, and routing for NextJS pages directory", "license": "MIT", "version": "1.1.0", "author": "Ethan Niser", From ceab984a93d6adb95eb506725c41402f65e32c82 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Mar 2023 15:31:26 +0000 Subject: [PATCH 2/4] Version Packages --- .changeset/lemon-socks-begin.md | 5 ----- .changeset/neat-garlics-wash.md | 5 ----- CHANGELOG.md | 7 +++++++ package.json | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 .changeset/lemon-socks-begin.md delete mode 100644 .changeset/neat-garlics-wash.md diff --git a/.changeset/lemon-socks-begin.md b/.changeset/lemon-socks-begin.md deleted file mode 100644 index a82bd63..0000000 --- a/.changeset/lemon-socks-begin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"next-typesafe-url": patch ---- - -docs: fix dependency array in jotai example diff --git a/.changeset/neat-garlics-wash.md b/.changeset/neat-garlics-wash.md deleted file mode 100644 index 83881ee..0000000 --- a/.changeset/neat-garlics-wash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"next-typesafe-url": patch ---- - -docs: clarify app router, add todo ts plugin, and clarify pages dir only in package desc diff --git a/CHANGELOG.md b/CHANGELOG.md index 01d3c28..409c52e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # next-typesafe-url +## 1.1.1 + +### Patch Changes + +- 351372d: docs: fix dependency array in jotai example +- decd6c9: docs: clarify app router, add todo ts plugin, and clarify pages dir only in package desc + ## 1.1.0 ### Minor Changes diff --git a/package.json b/package.json index 82a9bb7..35fdc04 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "next-typesafe-url", "description": "JSON serializable, fully typesafe, and zod validated URL search params, dynamic route params, and routing for NextJS pages directory", "license": "MIT", - "version": "1.1.0", + "version": "1.1.1", "author": "Ethan Niser", "repository": { "type": "git", From 0bd683fcfa974671ae4fac93a52e4a346bc83d33 Mon Sep 17 00:00:00 2001 From: Ethan Niser <100045248+ethanniser@users.noreply.github.com> Date: Thu, 16 Mar 2023 15:51:15 +0000 Subject: [PATCH 3/4] minor docs changes --- .changeset/hungry-timers-boil.md | 5 +++++ README.md | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .changeset/hungry-timers-boil.md diff --git a/.changeset/hungry-timers-boil.md b/.changeset/hungry-timers-boil.md new file mode 100644 index 0000000..b995d2a --- /dev/null +++ b/.changeset/hungry-timers-boil.md @@ -0,0 +1,5 @@ +--- +"next-typesafe-url": patch +--- + +docs: rephrase how potential cli issues worded + presented diff --git a/README.md b/README.md index 748383a..da50ce7 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,17 @@ pnpm add next-typesafe-url ## Setup +### IMPORTANT NOTE + +**This package requires you to run your npm scripts from the root directory of your project, as well as your `pages` directory being in `root/src`.** + --- -**Note:** This package requires you to run your npm scripts from the root directory of your project, as well as your `pages` directory being in `root/src`. +If you run into any issues it will most likely be the cli (*for me it works fine on my setup, but when using it in a github codespace the watch functionality wouldn't work*). + +**Assuming you have the correct directory structure as listed above**, a quick `npx next-typesafe-url` should generate the types and you'll be all set. + +*If the functions still show type errors, you can restart typescript server, but I have found a quick `crtl+click` to go the origin type file can often wake the ts server up much faster.* --- @@ -62,10 +70,6 @@ For dev mode, you can either run it in a seperate shell, or in one with the [con } ``` -### IMPORTANT NOTE - -The cli is probably the most likely part to _slightly_ break. If you run into issues just run a quick `npx next-typesafe-url` and it should generate the types. If the functions still show type errors, you can restart typescript server, but I have found a quick `crtl+click` to go the origin type file can often wake the ts server up much faster. - # Usage ## Route From 6a843d7c05c7b1bb2f4b5fce316d5d780bb408d1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Mar 2023 15:51:48 +0000 Subject: [PATCH 4/4] Version Packages --- .changeset/hungry-timers-boil.md | 5 ----- CHANGELOG.md | 6 ++++++ package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/hungry-timers-boil.md diff --git a/.changeset/hungry-timers-boil.md b/.changeset/hungry-timers-boil.md deleted file mode 100644 index b995d2a..0000000 --- a/.changeset/hungry-timers-boil.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"next-typesafe-url": patch ---- - -docs: rephrase how potential cli issues worded + presented diff --git a/CHANGELOG.md b/CHANGELOG.md index 409c52e..43691a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # next-typesafe-url +## 1.1.2 + +### Patch Changes + +- 0bd683f: docs: rephrase how potential cli issues worded + presented + ## 1.1.1 ### Patch Changes diff --git a/package.json b/package.json index 35fdc04..cccd466 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "next-typesafe-url", "description": "JSON serializable, fully typesafe, and zod validated URL search params, dynamic route params, and routing for NextJS pages directory", "license": "MIT", - "version": "1.1.1", + "version": "1.1.2", "author": "Ethan Niser", "repository": { "type": "git",