@paramour-js/next 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +48 -0
  2. package/package.json +13 -3
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # @paramour-js/next
2
+
3
+ The Next.js integration for [paramour](https://paramour.dev):
4
+ `withTypedRoutes` (build-time registry generation and drift checking),
5
+ typed client hooks for both routers, and the `paramour` CLI
6
+ (`generate` / `check` / `init` / `list` / `doctor`).
7
+
8
+ ```sh
9
+ pnpm add paramour @paramour-js/next
10
+ ```
11
+
12
+ Wrap your Next config so the route registry regenerates on dev and is
13
+ enforced on build:
14
+
15
+ ```ts
16
+ // next.config.ts
17
+ import { withTypedRoutes } from "@paramour-js/next";
18
+
19
+ export default withTypedRoutes({}, { strict: true });
20
+ ```
21
+
22
+ Client components read the URL through hooks that take the same route
23
+ object as everything else:
24
+
25
+ ```tsx
26
+ "use client";
27
+
28
+ import { useSearch } from "@paramour-js/next/app";
29
+
30
+ import { productRoute } from "./route.def";
31
+
32
+ export function FilterSummary() {
33
+ const search = useSearch(productRoute);
34
+ if (search.status === "error") return <p role="alert">Bad filters</p>;
35
+ return <p>query: {search.data.q ?? "none"}</p>;
36
+ }
37
+ ```
38
+
39
+ ## Docs
40
+
41
+ - [Getting started](https://paramour.dev/docs/getting-started)
42
+ - [Next API reference](https://paramour.dev/docs/reference/next)
43
+ - [CLI reference](https://paramour.dev/docs/reference/next/cli)
44
+ - [Hooks guide](https://paramour.dev/docs/guides/hooks)
45
+
46
+ ## License
47
+
48
+ MIT © Jason Paff
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paramour-js/next",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -30,7 +30,7 @@
30
30
  "jiti": "^2.7.0",
31
31
  "magicast": "^0.3.5",
32
32
  "tinyglobby": "^0.2.15",
33
- "paramour": "0.5.0"
33
+ "paramour": "0.5.1"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "next": ">=15",
@@ -50,13 +50,23 @@
50
50
  },
51
51
  "description": "Next.js integration for paramour: withTypedRoutes, App and Pages Router hooks, PageProps glue, and the codegen CLI.",
52
52
  "author": "Jason Paff <jasonpaff@gmail.com>",
53
+ "keywords": [
54
+ "nextjs",
55
+ "app-router",
56
+ "typescript",
57
+ "routing",
58
+ "type-safe",
59
+ "typed-routes",
60
+ "cli",
61
+ "codegen"
62
+ ],
53
63
  "license": "MIT",
54
64
  "repository": {
55
65
  "type": "git",
56
66
  "url": "git+https://github.com/JasonPaff/paramour.git",
57
67
  "directory": "packages/next"
58
68
  },
59
- "homepage": "https://github.com/JasonPaff/paramour#readme",
69
+ "homepage": "https://paramour.dev/docs/reference/next",
60
70
  "bugs": {
61
71
  "url": "https://github.com/JasonPaff/paramour/issues"
62
72
  },