@fecommunity/reactpress-template-hello-world 1.0.0 → 3.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/.next/build-manifest.json +35 -0
- package/.next/cache/.tsbuildinfo +1 -0
- package/.next/cache/webpack/client-development/0.pack +0 -0
- package/.next/cache/webpack/client-development/1.pack +0 -0
- package/.next/cache/webpack/client-development/index.pack +0 -0
- package/.next/cache/webpack/client-development/index.pack.old +0 -0
- package/.next/cache/webpack/client-development-fallback/0.pack +0 -0
- package/.next/cache/webpack/client-development-fallback/1.pack +0 -0
- package/.next/cache/webpack/client-development-fallback/index.pack +0 -0
- package/.next/cache/webpack/client-development-fallback/index.pack.old +0 -0
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-development/0.pack +0 -0
- package/.next/cache/webpack/server-development/1.pack +0 -0
- package/.next/cache/webpack/server-development/2.pack +0 -0
- package/.next/cache/webpack/server-development/index.pack +0 -0
- package/.next/cache/webpack/server-development/index.pack.old +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/1.pack +0 -0
- package/.next/cache/webpack/server-production/2.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/.next/fallback-build-manifest.json +27 -0
- package/.next/package.json +1 -0
- package/.next/react-loadable-manifest.json +1 -0
- package/.next/server/_error.js +66 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/pages/404.js +629 -0
- package/.next/server/pages/_app.js +76 -0
- package/.next/server/pages/_document.js +126 -0
- package/.next/server/pages/_error.js +66 -0
- package/.next/server/pages/index.js +1697 -0
- package/.next/server/pages-manifest.json +7 -0
- package/.next/server/webpack-runtime.js +168 -0
- package/.next/static/chunks/amp.js +961 -0
- package/.next/static/chunks/fallback/amp.js +961 -0
- package/.next/static/chunks/fallback/main.js +1266 -0
- package/.next/static/chunks/fallback/pages/_app.js +28 -0
- package/.next/static/chunks/fallback/pages/_error.js +28 -0
- package/.next/static/chunks/fallback/react-refresh.js +62 -0
- package/.next/static/chunks/fallback/webpack.js +1208 -0
- package/.next/static/chunks/main.js +1266 -0
- package/.next/static/chunks/pages/404.js +178 -0
- package/.next/static/chunks/pages/_app.js +28 -0
- package/.next/static/chunks/pages/_error.js +28 -0
- package/.next/static/chunks/polyfills.js +1 -0
- package/.next/static/chunks/react-refresh.js +62 -0
- package/.next/static/chunks/webpack.js +1220 -0
- package/.next/static/development/_buildManifest.js +1 -0
- package/.next/static/development/_ssgManifest.js +1 -0
- package/.next/static/webpack/82e97587a3709bd9.webpack.hot-update.json +1 -0
- package/.next/static/webpack/webpack.82e97587a3709bd9.hot-update.js +43 -0
- package/.next/trace +12 -0
- package/README.md +6 -6
- package/next-env.d.ts +1 -1
- package/package.json +2 -2
- package/pages/about.tsx +2 -2
- package/pages/index.tsx +2 -2
- package/pages/toolkit-demo.tsx +4 -4
package/README.md
CHANGED
|
@@ -62,10 +62,10 @@ This template demonstrates how to use all aspects of the ReactPress Toolkit:
|
|
|
62
62
|
### 1. API Client Usage
|
|
63
63
|
|
|
64
64
|
```typescript
|
|
65
|
-
import {
|
|
65
|
+
import { http } from '@fecommunity/reactpress-toolkit';
|
|
66
66
|
|
|
67
67
|
// Create a custom API instance
|
|
68
|
-
const customApi = createApiInstance({
|
|
68
|
+
const customApi = http.createApiInstance({
|
|
69
69
|
baseURL: 'https://api.gaoredu.com/'
|
|
70
70
|
});
|
|
71
71
|
|
|
@@ -111,14 +111,14 @@ if (utils.ApiError.isInstance(error)) {
|
|
|
111
111
|
The toolkit demo page shows a complete example of using all toolkit features:
|
|
112
112
|
|
|
113
113
|
```typescript
|
|
114
|
-
import {
|
|
114
|
+
import { http } from '@fecommunity/reactpress-toolkit';
|
|
115
115
|
import { types, utils } from '@fecommunity/reactpress-toolkit';
|
|
116
116
|
|
|
117
117
|
// Type definitions
|
|
118
118
|
type IArticle = types.IArticle;
|
|
119
119
|
|
|
120
120
|
// API client with retry mechanism
|
|
121
|
-
const customApi = createApiInstance({
|
|
121
|
+
const customApi = http.createApiInstance({
|
|
122
122
|
baseURL: 'https://api.gaoredu.com/',
|
|
123
123
|
retry: {
|
|
124
124
|
retries: 3,
|
|
@@ -136,8 +136,8 @@ const formatDate = (dateString: string) => {
|
|
|
136
136
|
const handleApiError = (error: any) => {
|
|
137
137
|
if (utils.ApiError.isInstance(error)) {
|
|
138
138
|
console.error(`API Error ${error.code}: ${error.message}`);
|
|
139
|
-
// Log
|
|
140
|
-
|
|
139
|
+
// Log error
|
|
140
|
+
logError(error);
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
```
|
package/next-env.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fecommunity/reactpress-template-hello-world",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "A minimal hello-world template for ReactPress using Next.js Pages Router",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-reactpress-hello-world": "./bin/create-hello-world.js"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@fecommunity/reactpress-toolkit": "
|
|
10
|
+
"@fecommunity/reactpress-toolkit": "3.0.0",
|
|
11
11
|
"next": "^12.3.4",
|
|
12
12
|
"react": "17.0.2",
|
|
13
13
|
"react-dom": "17.0.2",
|
package/pages/about.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { GetStaticProps } from 'next';
|
|
2
2
|
import Head from 'next/head';
|
|
3
3
|
import Link from 'next/link';
|
|
4
|
-
import {
|
|
4
|
+
import { http } from '@fecommunity/reactpress-toolkit';
|
|
5
5
|
import { types, utils } from '@fecommunity/reactpress-toolkit';
|
|
6
6
|
import Header from '../components/Header';
|
|
7
7
|
import Footer from '../components/Footer';
|
|
8
8
|
|
|
9
9
|
// Create a custom API instance with the desired baseURL
|
|
10
|
-
const customApi = createApiInstance({
|
|
10
|
+
const customApi = http.createApiInstance({
|
|
11
11
|
baseURL: 'https://api.gaoredu.com/'
|
|
12
12
|
});
|
|
13
13
|
|
package/pages/index.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { GetStaticProps } from 'next';
|
|
2
2
|
import Head from 'next/head';
|
|
3
3
|
import Link from 'next/link';
|
|
4
|
-
import {
|
|
4
|
+
import { http } from '@fecommunity/reactpress-toolkit';
|
|
5
5
|
import { types, utils } from '@fecommunity/reactpress-toolkit';
|
|
6
6
|
import Header from '../components/Header';
|
|
7
7
|
import Footer from '../components/Footer';
|
|
8
8
|
|
|
9
9
|
// Create a custom API instance with the desired baseURL
|
|
10
|
-
const customApi = createApiInstance({
|
|
10
|
+
const customApi = http.createApiInstance({
|
|
11
11
|
baseURL: 'https://api.gaoredu.com/'
|
|
12
12
|
});
|
|
13
13
|
|
package/pages/toolkit-demo.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { GetStaticProps } from 'next';
|
|
2
2
|
import Head from 'next/head';
|
|
3
3
|
import Link from 'next/link';
|
|
4
|
-
import { types, utils
|
|
4
|
+
import { http, api, types, utils } from '@fecommunity/reactpress-toolkit';
|
|
5
5
|
import Header from '../components/Header';
|
|
6
6
|
import Footer from '../components/Footer';
|
|
7
7
|
|
|
8
8
|
// Create a custom API instance with the desired baseURL
|
|
9
|
-
const customApi = createApiInstance({
|
|
9
|
+
const customApi = http.createApiInstance({
|
|
10
10
|
baseURL: 'https://api.gaoredu.com/',
|
|
11
11
|
});
|
|
12
12
|
|
|
@@ -65,7 +65,7 @@ export default function ToolkitDemo({ articles, categories, tags, stats }: Toolk
|
|
|
65
65
|
<div className="features-grid">
|
|
66
66
|
<div className="feature-card">
|
|
67
67
|
<h3 className="feature-title">API Client</h3>
|
|
68
|
-
<p className="feature-description">Use createApiInstance() to create custom API clients</p>
|
|
68
|
+
<p className="feature-description">Use http.createApiInstance() to create custom API clients</p>
|
|
69
69
|
</div>
|
|
70
70
|
<div className="feature-card">
|
|
71
71
|
<h3 className="feature-title">Types</h3>
|
|
@@ -487,4 +487,4 @@ export const getStaticProps: GetStaticProps<ToolkitDemoProps> = async () => {
|
|
|
487
487
|
revalidate: 60,
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
|
-
};
|
|
490
|
+
};
|