xplorajs-react 0.3.0 → 0.3.7

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.
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,18 @@
1
- export { renderToStream, generateStaticPage, getStaticProps } from "./render";
2
- //# sourceMappingURL=index.d.ts.map
1
+ import type React from "react";
2
+
3
+ export function renderToStream(
4
+ element: React.ReactElement,
5
+ ): Promise<ReadableStream | string>;
6
+
7
+ export function generateStaticPage(options: {
8
+ component: React.ReactElement;
9
+ outputPath: string;
10
+ props?: Record<string, unknown>;
11
+ }): Promise<void>;
12
+
13
+ export function getStaticProps(
14
+ fn: () => Promise<Record<string, unknown>>,
15
+ ): Promise<{
16
+ props: Record<string, unknown>;
17
+ revalidate: number;
18
+ }>;
package/package.json CHANGED
@@ -1,28 +1,34 @@
1
1
  {
2
2
  "name": "xplorajs-react",
3
- "version": "0.3.0",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
- "main": "dist/index.js",
6
- "module": "dist/index.mjs",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/XplorationTechnologies/xplora.js.git"
8
+ },
9
+ "exports": {
10
+ ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" }
11
+ },
7
12
  "types": "dist/index.d.ts",
8
13
  "files": [
9
14
  "dist",
10
15
  "README.md"
11
16
  ],
17
+ "sideEffects": false,
12
18
  "scripts": {
13
- "build": "swc src -d dist && tsc --emitDeclarationOnly",
19
+ "build": "swc src -d dist && cp src/index.d.ts dist/index.d.ts",
14
20
  "dev": "swc src -d dist --watch",
15
21
  "prepublishOnly": "bun run build"
16
22
  },
17
23
  "devDependencies": {
18
24
  "@swc/cli": "^0.1.65",
19
- "@swc/core": "^1.11.24"
25
+ "@swc/core": "^1.11.24",
26
+ "@types/react": "^19.1.4",
27
+ "@types/react-dom": "^19.1.5"
20
28
  },
21
29
  "peerDependencies": {
22
30
  "react": "^19.1.0",
23
- "react-dom": "^19.1.0",
24
- "@types/react": "^19.1.4",
25
- "@types/react-dom": "^19.1.5"
31
+ "react-dom": "^19.1.0"
26
32
  },
27
33
  "publishConfig": {
28
34
  "access": "public"
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
package/dist/render.d.ts DELETED
@@ -1,22 +0,0 @@
1
- import type React from "react";
2
- /**
3
- * Render React element ke stream HTML untuk development mode (SSR).
4
- * Otomatis fallback ke string jika Streaming tidak didukung.
5
- */
6
- export declare function renderToStream(element: React.ReactElement): Promise<string | import("react-dom/server").ReactDOMServerReadableStream>;
7
- /**
8
- * Generate static HTML file untuk production mode (SSG).
9
- */
10
- export declare function generateStaticPage(options: {
11
- component: React.ReactElement;
12
- outputPath: string;
13
- props?: Record<string, unknown>;
14
- }): Promise<void>;
15
- /**
16
- * Get static props untuk data fetching di build time.
17
- */
18
- export declare function getStaticProps(fn: () => Promise<Record<string, unknown>>): Promise<{
19
- props: Record<string, unknown>;
20
- revalidate: number;
21
- }>;
22
- //# sourceMappingURL=render.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,6EAK/D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE;IAChD,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,iBAQA;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,EAAE,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;GAe3C"}