@xwadex/fesd-next 0.1.49 → 0.1.50

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,22 +1,25 @@
1
1
  {
2
2
  "name": "@xwadex/fesd-next",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "private": false,
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
+ "types": "./dist/index.d.ts",
10
11
  "import": "./dist/index.js",
11
12
  "require": "./dist/index.cjs"
12
13
  },
13
- "./server/Greeting": {
14
- "import": "./dist/server/Greeting.js",
15
- "require": "./dist/server/Greeting.cjs"
14
+ "./server/*": {
15
+ "types": "./dist/server/*.d.ts",
16
+ "import": "./dist/server/*.js",
17
+ "require": "./dist/server/*.cjs"
16
18
  },
17
- "./client/Button": {
18
- "import": "./dist/client/Button.js",
19
- "require": "./dist/client/Button.cjs"
19
+ "./client/*": {
20
+ "types": "./dist/client/*.d.ts",
21
+ "import": "./dist/client/*.js",
22
+ "require": "./dist/client/*.cjs"
20
23
  }
21
24
  },
22
25
  "scripts": {
@@ -24,8 +27,18 @@
24
27
  "dev": "tsup --watch"
25
28
  },
26
29
  "peerDependencies": {
27
- "next": "^15.0.0",
28
- "react": "^18.0.0",
29
- "react-dom": "^18.0.0"
30
+ "next": "^15.2.2",
31
+ "react": "^19.0.0",
32
+ "react-dom": "^19.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "^22.13.10",
36
+ "@types/react": "^19.0.10",
37
+ "@types/react-dom": "^19.0.4",
38
+ "next": "^15.2.2",
39
+ "react": "^19.0.0",
40
+ "react-dom": "^19.0.0",
41
+ "tsup": "^8.4.0",
42
+ "typescript": "^5.8.2"
30
43
  }
31
44
  }
package/tsconfig.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "outDir": "dist",
4
- "declaration": true,
5
- "declarationMap": true,
6
- "sourceMap": true,
7
- "module": "ESNext",
8
- "target": "ESNext",
9
- "jsx": "react-jsx",
10
- "moduleResolution": "Node",
11
- "resolveJsonModule": true,
12
- "strict": true,
13
- "esModuleInterop": true,
14
- "skipLibCheck": true
3
+ "outDir": "dist", // 編譯後的輸出目錄
4
+ "declaration": true, // 生成 `.d.ts` 文件
5
+ "declarationMap": false, // 不生成 `.d.ts.map` 文件(如果不需要調試型別)
6
+ "sourceMap": true, // 生成 `.map` 文件
7
+ "module": "ESNext", // 使用最新的 ES 模組
8
+ "target": "ESNext", // 使用最新的 ES 語法特性
9
+ "jsx": "react-jsx", // 支援 React 17+ JSX 轉換
10
+ "moduleResolution": "Node", // 使用 Node.js 模組解析策略
11
+ "resolveJsonModule": true, // 支援導入 JSON 檔案
12
+ "strict": true, // 啟用所有嚴格型別檢查選項
13
+ "esModuleInterop": true, // 支援 CommonJS 模組與 ES 模組互操作
14
+ "skipLibCheck": true, // 跳過庫文件型別檢查
15
+ "forceConsistentCasingInFileNames": true // 確保檔案名大小寫一致性
15
16
  },
16
- "include": ["src"]
17
+ "include": ["src"] // 指定 TypeScript 編譯的檔案範圍
17
18
  }
package/tsup.config.ts CHANGED
@@ -3,8 +3,13 @@ import { defineConfig } from "tsup";
3
3
  export default defineConfig({
4
4
  entry: ["src/index.ts"],
5
5
  format: ["cjs", "esm"],
6
- dts: true,
6
+ dts: {
7
+ entry: "src/index.ts", // 確保型別文件生成
8
+ resolve: true, // 確保外部引用的型別可以正確解析
9
+ },
7
10
  sourcemap: true,
8
11
  clean: true,
9
- external: ["next", "react", "react-dom"],
10
- });
12
+ external: ["next", "react", "react-dom"], // 確保這些模組不被打包
13
+ shims: false, // 避免 `export {}` 影響型別解析
14
+ target: "esnext", // 讓 ESM 使用最新 ES 語法
15
+ });