@questpie/next 0.0.1 → 1.0.0

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 CHANGED
@@ -1,18 +1,18 @@
1
1
  # @questpie/next
2
2
 
3
- Next.js App Router adapter for QUESTPIE CMS.
3
+ Next.js App Router adapter for QUESTPIE.
4
4
 
5
5
  ## Features
6
6
 
7
7
  - **App Router Support** - Catch-all route handlers for Next.js 13+
8
- - **Type-Safe Client** - Full TypeScript support with `@questpie/cms/client`
8
+ - **Type-Safe Client** - Full TypeScript support with `questpie/client`
9
9
  - **Server Components** - Works with React Server Components
10
10
  - **Edge Runtime** - Compatible with Edge Runtime (with limitations)
11
11
 
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- bun add @questpie/next @questpie/cms
15
+ bun add @questpie/next questpie
16
16
  ```
17
17
 
18
18
  ## Quick Start
@@ -21,9 +21,9 @@ bun add @questpie/next @questpie/cms
21
21
 
22
22
  ```typescript
23
23
  // src/cms/index.ts
24
- import { defineQCMS } from "@questpie/cms";
24
+ import { questpie } from "questpie";
25
25
 
26
- export const cms = defineQCMS()
26
+ export const cms = questpie()
27
27
  .db({ connectionString: process.env.DATABASE_URL! })
28
28
  .collections({
29
29
  /* your collections */
@@ -59,10 +59,10 @@ export const dynamic = "force-dynamic";
59
59
 
60
60
  ```typescript
61
61
  // src/lib/cms-client.ts
62
- import { createQCMSClient } from "@questpie/cms/client";
62
+ import { createClient } from "questpie/client";
63
63
  import type { AppCMS } from "@/cms";
64
64
 
65
- export const cmsClient = createQCMSClient<AppCMS>({
65
+ export const cmsClient = createClient<AppCMS>({
66
66
  baseURL: process.env.NEXT_PUBLIC_URL!,
67
67
  basePath: "/api/cms",
68
68
  });
@@ -278,7 +278,7 @@ S3_SECRET_KEY=...
278
278
 
279
279
  ## Related Packages
280
280
 
281
- - [`@questpie/cms`](../cms) - Core CMS engine
281
+ - [`questpie`](../questpie) - Core CMS engine
282
282
  - [`@questpie/admin`](../admin) - Admin UI
283
283
  - [`@questpie/tanstack-query`](../tanstack-query) - TanStack Query integration
284
284
 
package/dist/server.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { CMSAdapterConfig, Questpie } from "questpie";
1
+ import { AdapterConfig, Questpie } from "questpie";
2
2
 
3
3
  //#region src/server.d.ts
4
- type NextAdapterConfig = CMSAdapterConfig;
4
+ type NextAdapterConfig = AdapterConfig;
5
5
  type NextHandler = (request: Request) => Promise<Response>;
6
6
  /**
7
7
  * Create a Next.js-compatible handler for QUESTPIE CMS routes.
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@questpie/next",
3
- "version": "0.0.1",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/questpie/questpie-cms.git",
8
+ "directory": "packages/next"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
5
13
  "scripts": {
6
14
  "build": "tsdown",
7
15
  "check-types": "tsc --noEmit"
@@ -1,14 +0,0 @@
1
-
2
- $ tsdown
3
- ℹ tsdown v0.18.4 powered by rolldown v1.0.0-beta.57
4
- ℹ config file: /Users/drepkovsky/questpie/repos/questpie-cms/packages/next/tsdown.config.ts
5
- (node:61187) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
6
- (Use `node --trace-warnings ...` to show where the warning was created)
7
- ℹ entry: src/server.ts
8
- ℹ tsconfig: tsconfig.json
9
- ℹ Build start
10
- ℹ Cleaning 2 files
11
- ℹ dist/server.mjs 0.84 kB │ gzip: 0.43 kB
12
- ℹ dist/server.d.mts 0.61 kB │ gzip: 0.31 kB
13
- ℹ 2 files, total: 1.46 kB
14
- ✔ Build complete in 5270ms
@@ -1 +0,0 @@
1
- $ tsc --noEmit
package/CHANGELOG.md DELETED
@@ -1,9 +0,0 @@
1
- # @questpie/next
2
-
3
- ## 0.0.1
4
-
5
- ### Patch Changes
6
-
7
- - feat: initial release
8
- - Updated dependencies
9
- - questpie@0.0.1
package/src/server.ts DELETED
@@ -1,48 +0,0 @@
1
- import { createFetchHandler, type CMSAdapterConfig, type Questpie } from "questpie";
2
-
3
- export type NextAdapterConfig = CMSAdapterConfig;
4
-
5
- type NextHandler = (request: Request) => Promise<Response>;
6
-
7
- const notFoundResponse = () =>
8
- new Response(JSON.stringify({ error: "Not found" }), {
9
- status: 404,
10
- headers: {
11
- "Content-Type": "application/json",
12
- },
13
- });
14
-
15
- /**
16
- * Create a Next.js-compatible handler for QUESTPIE CMS routes.
17
- */
18
- export const questpieNext = (
19
- cms: Questpie<any>,
20
- config: NextAdapterConfig = {},
21
- ): NextHandler => {
22
- const handler = createFetchHandler(cms, config);
23
-
24
- return async (request) => {
25
- const response = await handler(request);
26
- return response ?? notFoundResponse();
27
- };
28
- };
29
-
30
- /**
31
- * Convenience helpers for Next.js route handlers.
32
- */
33
- export const questpieNextRouteHandlers = (
34
- cms: Questpie<any>,
35
- config: NextAdapterConfig = {},
36
- ): Record<string, NextHandler> => {
37
- const handler = questpieNext(cms, config);
38
-
39
- return {
40
- GET: handler,
41
- POST: handler,
42
- PATCH: handler,
43
- DELETE: handler,
44
- PUT: handler,
45
- OPTIONS: handler,
46
- HEAD: handler,
47
- };
48
- };
package/tsconfig.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "@questpie/typescript-config/bun.json",
3
- "include": ["src/**/*"],
4
- "exclude": ["node_modules", "dist"]
5
- }