Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanniser committed Mar 16, 2023
2 parents 259a057 + 23739bf commit 268d1a5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
5 changes: 0 additions & 5 deletions .changeset/lemon-socks-begin.md

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# next-typesafe-url

## 1.1.2

### Patch Changes

- 0bd683f: docs: rephrase how potential cli issues worded + presented

## 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
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,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.*

---

Expand All @@ -64,10 +72,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
Expand Down Expand Up @@ -259,4 +263,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)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"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",
"version": "1.1.2",
"author": "Ethan Niser",
"repository": {
"type": "git",
Expand Down

0 comments on commit 268d1a5

Please sign in to comment.