@critical-path/server 0.1.0 โ 0.1.2
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.
- package/README.md +58 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @critical-path/server
|
|
2
|
+
|
|
3
|
+
> **Web Fetch API compatible server router & framework adapters for Critical Path.**
|
|
4
|
+
|
|
5
|
+
`@critical-path/server` bridges standard Web Fetch API `Request` and `Response` objects to `@critical-path/core`, offering turnkey adapters for **Next.js App Router** and **SvelteKit**.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ๐ฆ Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @critical-path/core @critical-path/server
|
|
13
|
+
# or
|
|
14
|
+
pnpm add @critical-path/core @critical-path/server
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## ๐ Next.js App Router Integration
|
|
20
|
+
|
|
21
|
+
File: `app/api/critical-path/[...path]/route.ts`
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { createNextHandler } from '@critical-path/server';
|
|
25
|
+
|
|
26
|
+
const handler = createNextHandler({
|
|
27
|
+
initialData: {
|
|
28
|
+
projects: [{ id: 'p1', key: 'PROJ', name: 'Product Roadmap' }]
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { handler as GET, handler as POST, handler as PUT, handler as PATCH, handler as DELETE, handler as OPTIONS };
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## ๐งก SvelteKit Integration
|
|
38
|
+
|
|
39
|
+
File: `src/routes/api/critical-path/[...path]/+server.ts`
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { createSvelteKitHandler } from '@critical-path/server';
|
|
43
|
+
|
|
44
|
+
const handler = createSvelteKitHandler();
|
|
45
|
+
|
|
46
|
+
export const GET = handler.GET;
|
|
47
|
+
export const POST = handler.POST;
|
|
48
|
+
export const PUT = handler.PUT;
|
|
49
|
+
export const PATCH = handler.PATCH;
|
|
50
|
+
export const DELETE = handler.DELETE;
|
|
51
|
+
export const OPTIONS = handler.OPTIONS;
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## ๐ License
|
|
57
|
+
|
|
58
|
+
MIT ยฉ [Critical Path](https://github.com/Pixerate/Critical-Path)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@critical-path/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Web Fetch API compatible server router and adapters for Next.js App Router, SvelteKit, and Express",
|
|
5
5
|
"author": "Jack James",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@critical-path/core": "0.1.
|
|
25
|
+
"@critical-path/core": "0.1.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^24.0.0",
|