xplorajs 0.0.1 → 0.0.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 CHANGED
@@ -1,6 +1,7 @@
1
1
  # XploraJS Core 🎯
2
2
 
3
- Package utama dari framework XploraJS yang menyediakan fungsionalitas inti untuk static site generation.
3
+ Package utama dari framework XploraJS yang menyediakan fungsionalitas inti untuk
4
+ static site generation.
4
5
 
5
6
  ## 🚀 Fitur
6
7
 
@@ -37,6 +38,7 @@ xplora preview
37
38
  ### Development Mode
38
39
 
39
40
  Development mode menggunakan SSR untuk:
41
+
40
42
  - Hot Module Replacement (HMR)
41
43
  - Instant feedback saat development
42
44
  - Real-time data fetching
@@ -45,6 +47,7 @@ Development mode menggunakan SSR untuk:
45
47
  ### Production Mode
46
48
 
47
49
  Production mode menggunakan SSG untuk:
50
+
48
51
  - Performa optimal
49
52
  - SEO yang lebih baik
50
53
  - Hosting yang lebih murah
@@ -55,26 +58,26 @@ Production mode menggunakan SSG untuk:
55
58
  Buat file `xplora.config.ts` di root project:
56
59
 
57
60
  ```typescript
58
- import { defineConfig } from 'xplora'
61
+ import { defineConfig } from "xplora";
59
62
 
60
63
  export default defineConfig({
61
64
  // Development options
62
65
  dev: {
63
66
  port: 3000,
64
- hmr: true
67
+ hmr: true,
65
68
  },
66
69
  // Static generation options
67
70
  static: {
68
- outputDir: './dist',
71
+ outputDir: "./dist",
69
72
  revalidate: 3600, // ISR interval in seconds
70
- fallback: false
73
+ fallback: false,
71
74
  },
72
75
  // Build options
73
76
  build: {
74
77
  minify: true,
75
- sourcemap: true
76
- }
77
- })
78
+ sourcemap: true,
79
+ },
80
+ });
78
81
  ```
79
82
 
80
83
  ## 📚 API Reference
@@ -97,8 +100,9 @@ export default defineConfig({
97
100
 
98
101
  ## 🤝 Kontribusi
99
102
 
100
- Kami menyambut kontribusi! Silakan baca [CONTRIBUTING.md](../../CONTRIBUTING.md) untuk panduan kontribusi.
103
+ Kami menyambut kontribusi! Silakan baca [CONTRIBUTING.md](../../CONTRIBUTING.md)
104
+ untuk panduan kontribusi.
101
105
 
102
106
  ## 📝 Lisensi
103
107
 
104
- MIT License - lihat [LICENSE](../../LICENSE) untuk detail lebih lanjut.
108
+ MIT License - lihat [LICENSE](../../LICENSE) untuk detail lebih lanjut.
@@ -155,7 +155,6 @@ function processPage(page, route) {
155
155
  case 1:
156
156
  module = _state.sent();
157
157
  PageComponent = module.default;
158
- // Check if page has getStaticProps
159
158
  getStaticProps = module.getStaticProps;
160
159
  props = {};
161
160
  if (!getStaticProps) return [
@@ -171,7 +170,6 @@ function processPage(page, route) {
171
170
  props = result.props;
172
171
  _state.label = 3;
173
172
  case 3:
174
- // Generate static HTML
175
173
  outputPath = join(process.cwd(), "dist", route.path, "index.html");
176
174
  return [
177
175
  4,
@@ -210,7 +208,6 @@ export function build() {
210
208
  switch(_state.label){
211
209
  case 0:
212
210
  console.log("Building application...");
213
- // Create dist directory
214
211
  return [
215
212
  4,
216
213
  mkdir(join(process.cwd(), "dist"), {
@@ -289,12 +286,10 @@ export function build() {
289
286
  7
290
287
  ];
291
288
  case 10:
292
- // Generate routes configuration
293
289
  routesConfig = {
294
290
  routes: routes,
295
291
  generatedAt: new Date().toISOString()
296
292
  };
297
- // Write routes configuration
298
293
  return [
299
294
  4,
300
295
  writeFile(join(process.cwd(), ".xplora", "routes.json"), JSON.stringify(routesConfig, null, 2))
@@ -244,11 +244,9 @@ export function dev() {
244
244
  switch(_state.label){
245
245
  case 0:
246
246
  console.log("Starting development server...");
247
- // Start WebSocket server for HMR
248
247
  wss = new WebSocketServer({
249
248
  port: 3001
250
249
  });
251
- // Watch for file changes
252
250
  watcher = watch([
253
251
  "src/**/*"
254
252
  ], {
@@ -276,7 +274,6 @@ export function dev() {
276
274
  _state.sent();
277
275
  _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
278
276
  try {
279
- // Notify clients about the change
280
277
  for(_iterator = wss.clients[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
281
278
  client = _step.value;
282
279
  if (client.readyState === WebSocket.OPEN) {
@@ -306,7 +303,6 @@ export function dev() {
306
303
  });
307
304
  })();
308
305
  });
309
- // Initial build and page load
310
306
  return [
311
307
  4,
312
308
  build()
@@ -319,7 +315,6 @@ export function dev() {
319
315
  ];
320
316
  case 2:
321
317
  _state.sent();
322
- // Start development server
323
318
  serve({
324
319
  port: 3000,
325
320
  fetch: function fetch(req) {
package/package.json CHANGED
@@ -1,37 +1,40 @@
1
1
  {
2
- "name": "xplorajs",
3
- "version": "0.0.1",
4
- "main": "dist/index.js",
5
- "module": "dist/index.mjs",
6
- "types": "dist/index.d.ts",
7
- "bin": {
8
- "xplora": "./dist/cli.js"
9
- },
10
- "files": ["dist", "README.md"],
11
- "scripts": {
12
- "dev": "bun run build --watch",
13
- "build": "swc src -d dist",
14
- "prepublishOnly": "bun run build"
15
- },
16
- "dependencies": {
17
- "@swc/cli": "^0.1.65",
18
- "@swc/core": "^1.11.24",
19
- "chokidar": "^3.6.0",
20
- "commander": "^11.0.0",
21
- "fast-glob": "^3.3.3",
22
- "ws": "^8.18.2",
23
- "xplorajs-react": "workspace:*"
24
- },
25
- "devDependencies": {
26
- "@types/bun": "^1.2.13",
27
- "@types/ws": "^8.18.1",
28
- "react-refresh": "^0.17.0"
29
- },
30
- "peerDependencies": {
31
- "react": "^19.1.0",
32
- "react-dom": "^19.1.0"
33
- },
34
- "publishConfig": {
35
- "access": "public"
36
- }
2
+ "name": "xplorajs",
3
+ "version": "0.0.2",
4
+ "main": "dist/index.js",
5
+ "module": "dist/index.mjs",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "xplora": "dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "dev": "bun run build --watch",
16
+ "build": "swc src -d dist",
17
+ "prepublishOnly": "bun run build"
18
+ },
19
+ "dependencies": {
20
+ "@swc/cli": "^0.1.65",
21
+ "@swc/core": "^1.11.24",
22
+ "chokidar": "^3.6.0",
23
+ "commander": "^11.0.0",
24
+ "fast-glob": "^3.3.3",
25
+ "ws": "^8.18.2",
26
+ "xplorajs-react": "^0.0.1"
27
+ },
28
+ "devDependencies": {
29
+ "@types/bun": "^1.2.13",
30
+ "@types/ws": "^8.18.1",
31
+ "react-refresh": "^0.17.0"
32
+ },
33
+ "peerDependencies": {
34
+ "react": "^19.1.0",
35
+ "react-dom": "^19.1.0"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ }
37
40
  }