@wrdagency/react-islands 0.1.0 → 0.1.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/package.json CHANGED
@@ -1,10 +1,22 @@
1
1
  {
2
2
  "name": "@wrdagency/react-islands",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
- "module": "./dist/index.mjs",
7
- "types": "./dist/index.d.ts",
6
+ "files": [
7
+ "dist",
8
+ "src"
9
+ ],
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./server": {
16
+ "types": "./dist/server.ts",
17
+ "default": "./dist/server.js"
18
+ }
19
+ },
8
20
  "scripts": {
9
21
  "build": "tsup"
10
22
  },
@@ -15,7 +27,7 @@
15
27
  "author": "Kyle Thomas Cooper @ WRD",
16
28
  "license": "MIT",
17
29
  "devDependencies": {
18
- "@types/react-dom": "^18.2.23",
30
+ "@types/react-dom": "^19.1.6",
19
31
  "tsup": "^8.0.2",
20
32
  "typescript": "^5.4.3"
21
33
  },
@@ -24,6 +36,6 @@
24
36
  "url": "https://github.com/kyletcooper/react-islands"
25
37
  },
26
38
  "peerDependencies": {
27
- "react-dom": "^18.2.0"
39
+ "react-dom": "^19.1.0"
28
40
  }
29
41
  }
package/src/index.tsx CHANGED
@@ -1,8 +1,10 @@
1
1
  import { FC, PropsWithChildren, useEffect, useRef } from "react";
2
- import { Island, IslandOpts, IslandRenderOpts } from "./types";
3
2
  import { createRoot, hydrateRoot } from "react-dom/client";
3
+ import { Island, IslandOpts, IslandRenderOpts } from "./types";
4
+
5
+ export { Island };
4
6
 
5
- export default function createIsland(component: FC, opts: IslandOpts): Island {
7
+ export function createIsland(component: FC, opts: IslandOpts): Island {
6
8
  const mergedOpts: Required<IslandOpts> = {
7
9
  multiple: false,
8
10
  selector: `[data-hydrate="${opts.name}"]`,
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "./dist/",
4
- "target": "es2016",
5
- "module": "Node16",
6
- "jsx": "react-jsx",
7
- "esModuleInterop": true,
8
- "allowSyntheticDefaultImports": true,
9
- "forceConsistentCasingInFileNames": true,
10
- "strict": true,
11
- "skipLibCheck": true
12
- },
13
- "exclude": ["dist", "node_modules"]
14
- }
package/tsup.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import { defineConfig } from "tsup";
2
-
3
- export default defineConfig({
4
- entry: ["src/index.tsx", "src/server.tsx"],
5
- format: ["cjs", "esm"],
6
- dts: true,
7
- splitting: false,
8
- sourcemap: true,
9
- clean: true,
10
- });