@mints-cloud/cxf-codegen 1.0.0 → 1.0.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.
- package/README.md +18 -9
- package/dist/register.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,33 +15,34 @@ Your project needs thin wrapper files that import from this library. The `create
|
|
|
15
15
|
### `pages/_app.tsx`
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
|
-
import
|
|
19
|
-
|
|
18
|
+
import '@/styles/globals.css'
|
|
19
|
+
import '@mints-cloud/cxf-codegen/register';
|
|
20
|
+
export { default } from '@mints-cloud/cxf-codegen/pages/app';
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
### `pages/api/[...path].ts`
|
|
23
24
|
|
|
24
25
|
```ts
|
|
25
|
-
export { default } from
|
|
26
|
+
export { default } from '@mints-cloud/cxf-codegen/pages/api/cxf';
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
### `pages/api/assets/[...path].ts`
|
|
29
30
|
|
|
30
31
|
```ts
|
|
31
|
-
export { default } from
|
|
32
|
+
export { default } from '@mints-cloud/cxf-codegen/pages/api/assets';
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
### `pages/plasmic-host.tsx`
|
|
35
36
|
|
|
36
37
|
```tsx
|
|
37
|
-
import
|
|
38
|
-
export { default } from
|
|
38
|
+
import '@mints-cloud/cxf-codegen/register';
|
|
39
|
+
export { default } from '@mints-cloud/cxf-codegen/pages/plasmic-host';
|
|
39
40
|
```
|
|
40
41
|
|
|
41
42
|
### `next.config.mjs`
|
|
42
43
|
|
|
43
44
|
```js
|
|
44
|
-
import { cxfNextConfig } from "cxf-codegen";
|
|
45
|
+
import { cxfNextConfig } from "@mints-cloud/cxf-codegen";
|
|
45
46
|
export default cxfNextConfig;
|
|
46
47
|
```
|
|
47
48
|
|
|
@@ -85,13 +86,21 @@ Data is available via `$ctx.response.*`:
|
|
|
85
86
|
Use `createServerProps` for pages that need pre-fetched data:
|
|
86
87
|
|
|
87
88
|
```tsx
|
|
88
|
-
import { ServerPageWrapper, createServerProps, ServerPageProps } from "cxf-codegen";
|
|
89
|
+
import { ServerPageWrapper, createServerProps, ServerPageProps } from "@mints-cloud/cxf-codegen";
|
|
89
90
|
import { PlasmicHomepage } from "../components/plasmic/Homepage";
|
|
90
91
|
|
|
91
92
|
function Homepage(props: ServerPageProps) {
|
|
92
93
|
return (
|
|
93
94
|
<ServerPageWrapper {...props}>
|
|
94
|
-
<
|
|
95
|
+
<GlobalContextsProvider>
|
|
96
|
+
<PageParamsProvider__
|
|
97
|
+
route={useRouter()?.pathname}
|
|
98
|
+
params={useRouter()?.query}
|
|
99
|
+
query={useRouter()?.query}
|
|
100
|
+
>
|
|
101
|
+
<PlasmicHomepage />
|
|
102
|
+
</PageParamsProvider__>
|
|
103
|
+
</GlobalContextsProvider>
|
|
95
104
|
</ServerPageWrapper>
|
|
96
105
|
);
|
|
97
106
|
}
|
package/dist/register.js
CHANGED
|
@@ -8,7 +8,7 @@ function registerCodeComponents() {
|
|
|
8
8
|
name: "ApiCall",
|
|
9
9
|
displayName: "API Call",
|
|
10
10
|
importName: "ApiCall",
|
|
11
|
-
importPath: "cxf-codegen/components/ApiCall",
|
|
11
|
+
importPath: "@mints-cloud/cxf-codegen/components/ApiCall",
|
|
12
12
|
section: "CXF",
|
|
13
13
|
description: "API caller for CXF. Auto-handles path prefixes and auth; provides data via $ctx.response.*. GET auto-fetches; other methods trigger via 'trigger'. If no children, no loading UI.",
|
|
14
14
|
providesData: true,
|