xplorajs-react 0.0.1 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +22 -20
  2. package/dist/render.js +0 -2
  3. package/package.json +32 -31
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # XploraJS React 🔄
2
2
 
3
- Package React untuk XploraJS yang menyediakan integrasi React dan static site generation.
3
+ Package React untuk XploraJS yang menyediakan integrasi React dan static site
4
+ generation.
4
5
 
5
6
  ## 🚀 Fitur
6
7
 
@@ -22,31 +23,31 @@ bun add xplora-react
22
23
  ### Basic Setup
23
24
 
24
25
  ```typescript
25
- import { generateStaticPage } from 'xplora-react'
26
+ import { generateStaticPage } from "xplora-react";
26
27
 
27
28
  // Generate static page
28
29
  await generateStaticPage({
29
30
  component: <App />,
30
- outputPath: './dist/index.html'
31
- })
31
+ outputPath: "./dist/index.html",
32
+ });
32
33
  ```
33
34
 
34
35
  ### Static Data Generation
35
36
 
36
37
  ```typescript
37
- import { getStaticProps } from 'xplora-react'
38
+ import { getStaticProps } from "xplora-react";
38
39
 
39
40
  export async function getStaticProps() {
40
41
  // Fetch data at build time
41
- const data = await fetchData()
42
-
42
+ const data = await fetchData();
43
+
43
44
  return {
44
45
  props: {
45
- data
46
+ data,
46
47
  },
47
48
  // Revalidate every hour
48
- revalidate: 3600
49
- }
49
+ revalidate: 3600,
50
+ };
50
51
  }
51
52
  ```
52
53
 
@@ -59,7 +60,7 @@ function generateStaticPage(options: {
59
60
  component: React.ReactElement;
60
61
  outputPath: string;
61
62
  props?: Record<string, any>;
62
- }): Promise<void>
63
+ }): Promise<void>;
63
64
  ```
64
65
 
65
66
  ### `getStaticProps`
@@ -68,7 +69,7 @@ function generateStaticPage(options: {
68
69
  function getStaticProps(): Promise<{
69
70
  props: Record<string, any>;
70
71
  revalidate?: number;
71
- }>
72
+ }>;
72
73
  ```
73
74
 
74
75
  ## 🔧 Konfigurasi
@@ -76,24 +77,25 @@ function getStaticProps(): Promise<{
76
77
  Konfigurasi React dapat dilakukan melalui `xplora.config.ts`:
77
78
 
78
79
  ```typescript
79
- import { defineConfig } from 'xplora'
80
+ import { defineConfig } from "xplora";
80
81
 
81
82
  export default defineConfig({
82
83
  react: {
83
84
  // Static generation options
84
85
  static: {
85
- outputDir: './dist',
86
+ outputDir: "./dist",
86
87
  revalidate: 3600, // ISR interval in seconds
87
- fallback: false
88
- }
89
- }
90
- })
88
+ fallback: false,
89
+ },
90
+ },
91
+ });
91
92
  ```
92
93
 
93
94
  ## 🤝 Kontribusi
94
95
 
95
- Kami menyambut kontribusi! Silakan baca [CONTRIBUTING.md](../../CONTRIBUTING.md) untuk panduan kontribusi.
96
+ Kami menyambut kontribusi! Silakan baca [CONTRIBUTING.md](../../CONTRIBUTING.md)
97
+ untuk panduan kontribusi.
96
98
 
97
99
  ## 📝 Lisensi
98
100
 
99
- MIT License - lihat [LICENSE](../../LICENSE) untuk detail lebih lanjut.
101
+ MIT License - lihat [LICENSE](../../LICENSE) untuk detail lebih lanjut.
package/dist/render.js CHANGED
@@ -155,7 +155,6 @@ import { renderToReadableStream, renderToString } from "react-dom/server";
155
155
  ];
156
156
  case 1:
157
157
  html = _state.sent();
158
- // Buat directory jika belum ada
159
158
  return [
160
159
  4,
161
160
  fs.mkdir(path.dirname(outputPath), {
@@ -164,7 +163,6 @@ import { renderToReadableStream, renderToString } from "react-dom/server";
164
163
  ];
165
164
  case 2:
166
165
  _state.sent();
167
- // Tulis file HTML
168
166
  return [
169
167
  4,
170
168
  fs.writeFile(outputPath, html)
package/package.json CHANGED
@@ -1,33 +1,34 @@
1
1
  {
2
- "name": "xplorajs-react",
3
- "version": "0.0.1",
4
- "main": "dist/index.js",
5
- "module": "dist/index.mjs",
6
- "types": "dist/index.d.ts",
7
- "files": [
8
- "dist",
9
- "README.md"
10
- ],
11
- "scripts": {
12
- "build": "swc src -d dist",
13
- "dev": "swc src -d dist --watch",
14
- "prepublishOnly": "bun run build"
15
- },
16
- "dependencies": {
17
- "react": "^19.1.0",
18
- "react-dom": "^19.1.0"
19
- },
20
- "devDependencies": {
21
- "@types/react": "^18.2.0",
22
- "@types/react-dom": "^18.2.0",
23
- "@swc/cli": "^0.1.65",
24
- "@swc/core": "^1.11.24"
25
- },
26
- "peerDependencies": {
27
- "react": "^19.1.0",
28
- "react-dom": "^19.1.0"
29
- },
30
- "publishConfig": {
31
- "access": "public"
32
- }
2
+ "name": "xplorajs-react",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "README.md"
11
+ ],
12
+ "scripts": {
13
+ "build": "swc src -d dist",
14
+ "dev": "swc src -d dist --watch",
15
+ "prepublishOnly": "bun run build"
16
+ },
17
+ "dependencies": {
18
+ "react": "^19.1.0",
19
+ "react-dom": "^19.1.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/react": "^18.2.0",
23
+ "@types/react-dom": "^18.2.0",
24
+ "@swc/cli": "^0.1.65",
25
+ "@swc/core": "^1.11.24"
26
+ },
27
+ "peerDependencies": {
28
+ "react": "^19.1.0",
29
+ "react-dom": "^19.1.0"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ }
33
34
  }