wechat-emojis 1.0.0 → 2.0.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 (106) hide show
  1. package/README.md +82 -19
  2. package/assets/animal//345/217/221/346/212/226.png +0 -0
  3. package/assets/animal//347/214/252/345/244/264.png +0 -0
  4. package/assets/animal//350/267/263/350/267/263.png +0 -0
  5. package/assets/animal//350/275/254/345/234/210.png +0 -0
  6. package/assets/blessing//347/210/206/347/253/271.png +0 -0
  7. package/assets/blessing//347/231/274.png +0 -0
  8. package/assets/blessing//347/244/274/347/211/251.png +0 -0
  9. package/assets/face/Emm.png +0 -0
  10. package/assets/face//344/272/262/344/272/262.png +0 -0
  11. package/assets/face//345/201/267/347/254/221.png +0 -0
  12. package/assets/face//345/202/262/346/205/242.png +0 -0
  13. package/assets/face//345/206/215/350/247/201.png +0 -0
  14. package/assets/face//345/212/240/346/262/271.png +0 -0
  15. package/assets/face//345/217/221/345/221/206.png +0 -0
  16. package/assets/face//345/217/221/346/200/222.png +0 -0
  17. package/assets/face//345/217/257/346/200/234.png +0 -0
  18. package/assets/face//345/217/263/345/223/274/345/223/274.png +0 -0
  19. package/assets/face//345/217/271/346/260/224.png +0 -0
  20. package/assets/face//345/220/220.png +0 -0
  21. package/assets/face//345/221/262/347/211/231.png +0 -0
  22. package/assets/face//345/222/222/351/252/202.png +0 -0
  23. package/assets/face//345/223/207.png +0 -0
  24. package/assets/face//345/230/230.png +0 -0
  25. package/assets/face//345/230/277/345/223/210.png +0 -0
  26. package/assets/face//345/233/247.png +0 -0
  27. package/assets/face//345/233/260.png +0 -0
  28. package/assets/face//345/235/217/347/254/221.png +0 -0
  29. package/assets/face//345/244/247/345/223/255.png +0 -0
  30. package/assets/face//345/244/251/345/225/212.png +0 -0
  31. package/assets/face//345/245/270/347/254/221.png +0 -0
  32. package/assets/face//345/247/224/345/261/210.png +0 -0
  33. package/assets/face//345/256/263/347/276/236.png +0 -0
  34. package/assets/face//345/260/264/345/260/254.png +0 -0
  35. package/assets/face//345/276/227/346/204/217.png +0 -0
  36. package/assets/face//345/276/256/347/254/221.png +0 -0
  37. package/assets/face//345/277/253/345/223/255/344/272/206.png +0 -0
  38. package/assets/face//346/201/220/346/203/247.png +0 -0
  39. package/assets/face//346/202/240/351/227/262.png +0 -0
  40. package/assets/face//346/203/212/346/201/220.png +0 -0
  41. package/assets/face//346/203/212/350/256/266.png +0 -0
  42. package/assets/face//346/204/211/345/277/253.png +0 -0
  43. package/assets/face//346/206/250/347/254/221.png +0 -0
  44. package/assets/face//346/211/223/350/204/270.png +0 -0
  45. package/assets/face//346/212/223/347/213/202.png +0 -0
  46. package/assets/face//346/212/240/351/274/273.png +0 -0
  47. package/assets/face//346/222/207/345/230/264.png +0 -0
  48. package/assets/face//346/223/246/346/261/227.png +0 -0
  49. package/assets/face//346/225/262/346/211/223.png +0 -0
  50. package/assets/face//346/227/240/350/257/255.png +0 -0
  51. package/assets/face//346/227/272/346/237/264.png +0 -0
  52. package/assets/face//346/231/225.png +0 -0
  53. package/assets/face//346/265/201/346/263/252.png +0 -0
  54. package/assets/face//347/226/221/351/227/256.png +0 -0
  55. package/assets/face//347/231/275/347/234/274.png +0 -0
  56. package/assets/face//347/232/261/347/234/211.png +0 -0
  57. package/assets/face//347/235/241.png +0 -0
  58. package/assets/face//347/244/276/344/274/232/347/244/276/344/274/232.png +0 -0
  59. package/assets/face//350/200/266.png +0 -0
  60. package/assets/face//350/204/270/347/272/242.png +0 -0
  61. package/assets/face//350/211/262.png +0 -0
  62. package/assets/face//350/213/246/346/266/251.png +0 -0
  63. package/assets/face//350/243/202/345/274/200.png +0 -0
  64. package/assets/face//350/256/251/346/210/221/347/234/213/347/234/213.png +0 -0
  65. package/assets/face//350/260/203/347/232/256.png +0 -0
  66. package/assets/face//351/227/255/345/230/264.png +0 -0
  67. package/assets/face//351/232/276/350/277/207.png +0 -0
  68. package/assets/face//351/252/267/351/253/205.png +0 -0
  69. package/assets/face//351/274/223/346/216/214.png +0 -0
  70. package/assets/gesture/OK.png +0 -0
  71. package/assets/gesture//345/213/276/345/274/225.png +0 -0
  72. package/assets/gesture//345/220/210/345/215/201.png +0 -0
  73. package/assets/gesture//345/274/261.png +0 -0
  74. package/assets/gesture//346/212/261/346/213/263.png +0 -0
  75. package/assets/gesture//346/213/245/346/212/261.png +0 -0
  76. package/assets/gesture//346/213/263/345/244/264.png +0 -0
  77. package/assets/gesture//346/217/241/346/211/213.png +0 -0
  78. package/assets/gesture//350/203/234/345/210/251.png +0 -0
  79. package/assets/other//344/276/277/344/276/277.png +0 -0
  80. package/assets/other//345/207/213/350/260/242.png +0 -0
  81. package/assets/other//345/222/226/345/225/241.png +0 -0
  82. package/assets/other//345/225/244/351/205/222.png +0 -0
  83. package/assets/other//345/230/264/345/224/207.png +0 -0
  84. package/assets/other//345/244/252/351/230/263.png +0 -0
  85. package/assets/other//345/277/203/347/242/216.png +0 -0
  86. package/assets/other//346/234/210/344/272/256.png +0 -0
  87. package/assets/other//347/202/270/345/274/271.png +0 -0
  88. package/assets/other//347/210/261/345/277/203.png +0 -0
  89. package/assets/other//347/216/253/347/221/260.png +0 -0
  90. package/assets/other//350/217/234/345/210/200.png +0 -0
  91. package/assets/other//350/233/213/347/263/225.png +0 -0
  92. package/dist/index.d.ts +162 -0
  93. package/{wechatEmoji.js → dist/index.js} +13 -13
  94. package/{API.md → docs/API.md} +8 -8
  95. package/docs/NPM_USAGE.md +223 -0
  96. package/{REACT_USAGE.md → docs/REACT_USAGE.md} +3 -4
  97. package/package.json +23 -15
  98. package/assets/face//347/244/276/344/274/232.png +0 -0
  99. package/assets/gesture//345/276/227/346/204/217.png +0 -0
  100. package/assets/gesture//350/200/266.png +0 -0
  101. package/assets/other//345/245/213/346/226/227.png +0 -0
  102. package/assets/other//346/231/232/345/256/211.png +0 -0
  103. package/assets/other//347/210/206/347/217/240.png +0 -0
  104. package/assets/other//347/210/206/347/253/271.png +0 -0
  105. package/assets/other//351/262/234/350/212/261.png +0 -0
  106. package/wechatEmoji.ts +0 -364
@@ -4,7 +4,15 @@
4
4
  * 提供类型安全的表情访问和图片路径获取功能
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getRandomEmoji = exports.getEmojiNames = exports.hasEmoji = exports.searchEmojis = exports.getAllEmojis = exports.getEmojisByCategory = exports.getEmojiInfo = exports.getEmojiPath = exports.EMOJI_CATEGORIES = exports.EmojiCategory = void 0;
7
+ exports.EMOJI_CATEGORIES = exports.EmojiCategory = void 0;
8
+ exports.getEmojiPath = getEmojiPath;
9
+ exports.getEmojiInfo = getEmojiInfo;
10
+ exports.getEmojisByCategory = getEmojisByCategory;
11
+ exports.getAllEmojis = getAllEmojis;
12
+ exports.searchEmojis = searchEmojis;
13
+ exports.hasEmoji = hasEmoji;
14
+ exports.getEmojiNames = getEmojiNames;
15
+ exports.getRandomEmoji = getRandomEmoji;
8
16
  /**
9
17
  * 表情类别枚举
10
18
  */
@@ -20,7 +28,7 @@ var EmojiCategory;
20
28
  EmojiCategory["BLESSING"] = "blessing";
21
29
  /** 其他表情 */
22
30
  EmojiCategory["OTHER"] = "other";
23
- })(EmojiCategory = exports.EmojiCategory || (exports.EmojiCategory = {}));
31
+ })(EmojiCategory || (exports.EmojiCategory = EmojiCategory = {}));
24
32
  /**
25
33
  * 表情数据映射
26
34
  * 将表情名称映射到完整的表情信息
@@ -90,7 +98,7 @@ const EMOJI_DATA = {
90
98
  '汗': { name: '汗', category: EmojiCategory.FACE, path: 'assets/face/汗.png' },
91
99
  '天啊': { name: '天啊', category: EmojiCategory.FACE, path: 'assets/face/天啊.png' },
92
100
  'Emm': { name: 'Emm', category: EmojiCategory.FACE, path: 'assets/face/Emm.png' },
93
- '社会': { name: '社会', category: EmojiCategory.FACE, path: 'assets/face/社会.png' },
101
+ '社会社会': { name: '社会社会', category: EmojiCategory.FACE, path: 'assets/face/社会社会.png' },
94
102
  '旺柴': { name: '旺柴', category: EmojiCategory.FACE, path: 'assets/face/旺柴.png' },
95
103
  '好的': { name: '好的', category: EmojiCategory.FACE, path: 'assets/face/好的.png' },
96
104
  '打脸': { name: '打脸', category: EmojiCategory.FACE, path: 'assets/face/打脸.png' },
@@ -138,8 +146,8 @@ const EMOJI_DATA = {
138
146
  '炸弹': { name: '炸弹', category: EmojiCategory.OTHER, path: 'assets/other/炸弹.png' },
139
147
  '便便': { name: '便便', category: EmojiCategory.OTHER, path: 'assets/other/便便.png' },
140
148
  '太阳': { name: '太阳', category: EmojiCategory.OTHER, path: 'assets/other/太阳.png' },
141
- '晚安': { name: '晚安', category: EmojiCategory.OTHER, path: 'assets/other/晚安.png' },
142
- '鲜花': { name: '鲜花', category: EmojiCategory.OTHER, path: 'assets/other/鲜花.png' }
149
+ '月亮': { name: '月亮', category: EmojiCategory.OTHER, path: 'assets/other/月亮.png' },
150
+ '玫瑰': { name: '玫瑰', category: EmojiCategory.OTHER, path: 'assets/other/玫瑰.png' }
143
151
  };
144
152
  /**
145
153
  * 获取所有表情数据的辅助函数
@@ -178,7 +186,6 @@ function getEmojiPath(name) {
178
186
  const emoji = EMOJI_DATA[name];
179
187
  return emoji ? emoji.path : null;
180
188
  }
181
- exports.getEmojiPath = getEmojiPath;
182
189
  /**
183
190
  * 获取表情信息
184
191
  * @param name 表情名称
@@ -193,7 +200,6 @@ exports.getEmojiPath = getEmojiPath;
193
200
  function getEmojiInfo(name) {
194
201
  return EMOJI_DATA[name] || null;
195
202
  }
196
- exports.getEmojiInfo = getEmojiInfo;
197
203
  /**
198
204
  * 根据类别获取表情列表
199
205
  * @param category 表情类别
@@ -207,7 +213,6 @@ exports.getEmojiInfo = getEmojiInfo;
207
213
  function getEmojisByCategory(category) {
208
214
  return exports.EMOJI_CATEGORIES[category];
209
215
  }
210
- exports.getEmojisByCategory = getEmojisByCategory;
211
216
  /**
212
217
  * 获取所有表情信息
213
218
  * @returns 所有表情的信息数组
@@ -221,7 +226,6 @@ exports.getEmojisByCategory = getEmojisByCategory;
221
226
  function getAllEmojis() {
222
227
  return getAllEmojiData();
223
228
  }
224
- exports.getAllEmojis = getAllEmojis;
225
229
  /**
226
230
  * 搜索表情
227
231
  * @param keyword 搜索关键词
@@ -236,7 +240,6 @@ exports.getAllEmojis = getAllEmojis;
236
240
  function searchEmojis(keyword) {
237
241
  return getAllEmojiData().filter(emoji => emoji.name.indexOf(keyword) !== -1);
238
242
  }
239
- exports.searchEmojis = searchEmojis;
240
243
  /**
241
244
  * 检查表情是否存在
242
245
  * @param name 表情名称
@@ -251,7 +254,6 @@ exports.searchEmojis = searchEmojis;
251
254
  function hasEmoji(name) {
252
255
  return name in EMOJI_DATA;
253
256
  }
254
- exports.hasEmoji = hasEmoji;
255
257
  /**
256
258
  * 获取表情名称列表
257
259
  * @param category 可选的类别筛选
@@ -275,7 +277,6 @@ function getEmojiNames(category) {
275
277
  }
276
278
  return names;
277
279
  }
278
- exports.getEmojiNames = getEmojiNames;
279
280
  /**
280
281
  * 随机获取表情
281
282
  * @param category 可选的类别筛选
@@ -292,7 +293,6 @@ function getRandomEmoji(category) {
292
293
  const randomIndex = Math.floor(Math.random() * emojis.length);
293
294
  return emojis[randomIndex];
294
295
  }
295
- exports.getRandomEmoji = getRandomEmoji;
296
296
  /**
297
297
  * 默认导出对象,包含所有主要功能
298
298
  */
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## 概述
4
4
 
5
- `wechatEmoji.ts` 提供了完整的 TypeScript 支持,让你可以类型安全地访问微信表情包资源。
5
+ `src/index.ts` 提供了完整的 TypeScript 支持,让你可以类型安全地访问微信表情包资源。
6
6
 
7
7
  ## 安装和使用
8
8
 
@@ -36,17 +36,17 @@ import WeChatEmojis, {
36
36
  getEmojiPath,
37
37
  getEmojisByCategory,
38
38
  searchEmojis
39
- } from './wechatEmoji';
39
+ } from './src';
40
40
  ```
41
41
 
42
42
  ### 3. 编译后使用 JavaScript
43
43
 
44
44
  ```bash
45
45
  # 编译 TypeScript
46
- npx tsc wechatEmoji.ts --target es2017 --module commonjs
46
+ npm run build
47
47
 
48
48
  # 在 Node.js 中使用
49
- const { getEmojiPath, EmojiCategory } = require('./wechatEmoji.js');
49
+ const { getEmojiPath, EmojiCategory } = require('./dist/index.js');
50
50
  ```
51
51
 
52
52
  ## API 参考
@@ -115,7 +115,7 @@ console.log(`人脸表情数量: ${faceEmojis.length}`); // 75
115
115
 
116
116
  ```typescript
117
117
  const allEmojis = getAllEmojis();
118
- console.log(`总表情数量: ${allEmojis.length}`); // 108
118
+ console.log(`总表情数量: ${allEmojis.length}`); // 109
119
119
  ```
120
120
 
121
121
  #### `searchEmojis(keyword: string): EmojiInfo[]`
@@ -213,12 +213,12 @@ const selectEmoji = (emoji: EmojiInfo) => {
213
213
 
214
214
  ## 数据统计
215
215
 
216
- - **总表情数量**: 108 个
216
+ - **总表情数量**: 109 个
217
217
  - **人脸表情**: 75 个
218
- - **手势表情**: 7 个
218
+ - **手势表情**: 10 个
219
219
  - **动物表情**: 4 个
220
220
  - **祝福表情**: 7 个
221
- - **其他表情**: 15 个
221
+ - **其他表情**: 13 个
222
222
 
223
223
  ## 注意事项
224
224
 
@@ -0,0 +1,223 @@
1
+ # 微信表情包 NPM 包使用指南
2
+
3
+ ### 1. 安装包
4
+
5
+ ```bash
6
+ npm install wechat-emojis
7
+ ```
8
+
9
+ ### 2. 在 React 项目中使用
10
+
11
+ #### 基础导入
12
+
13
+ ```typescript
14
+ import {
15
+ getEmojiPath,
16
+ getEmojisByCategory,
17
+ EmojiCategory,
18
+ searchEmojis,
19
+ getRandomEmoji,
20
+ type EmojiName
21
+ } from 'wechat-emojis';
22
+ ```
23
+
24
+ #### 创建表情组件
25
+
26
+ ```tsx
27
+ // components/WeChatEmoji.tsx
28
+ import React from 'react';
29
+ import { getEmojiPath, type EmojiName } from 'wechat-emojis';
30
+
31
+ interface WeChatEmojiProps {
32
+ name: EmojiName;
33
+ size?: number;
34
+ className?: string;
35
+ }
36
+
37
+ const WeChatEmoji: React.FC<WeChatEmojiProps> = ({
38
+ name,
39
+ size = 24,
40
+ className = ''
41
+ }) => {
42
+ const emojiPath = getEmojiPath(name);
43
+
44
+ if (!emojiPath) {
45
+ return null;
46
+ }
47
+
48
+ return (
49
+ <img
50
+ src={emojiPath}
51
+ alt={name}
52
+ width={size}
53
+ height={size}
54
+ className={`wechat-emoji ${className}`}
55
+ />
56
+ );
57
+ };
58
+
59
+ export default WeChatEmoji;
60
+ ```
61
+
62
+ #### 使用示例
63
+
64
+ ```tsx
65
+ // App.tsx
66
+ import React from 'react';
67
+ import WeChatEmoji from './components/WeChatEmoji';
68
+ import { getEmojisByCategory, EmojiCategory } from 'wechat-emojis';
69
+
70
+ function App() {
71
+ const faceEmojis = getEmojisByCategory(EmojiCategory.FACE);
72
+
73
+ return (
74
+ <div>
75
+ <h1>微信表情包示例</h1>
76
+
77
+ {/* 单个表情 */}
78
+ <WeChatEmoji name="微笑" size={32} />
79
+ <WeChatEmoji name="大哭" size={32} />
80
+
81
+ {/* 表情列表 */}
82
+ <div>
83
+ {faceEmojis.slice(0, 10).map(emoji => (
84
+ <WeChatEmoji key={emoji} name={emoji} size={24} />
85
+ ))}
86
+ </div>
87
+ </div>
88
+ );
89
+ }
90
+
91
+ export default App;
92
+ ```
93
+
94
+ ### 3. 处理静态资源
95
+
96
+ 由于表情图片是静态资源,你需要将它们复制到项目的 public 目录:
97
+
98
+ #### 方法一:手动复制
99
+
100
+ ```bash
101
+ # 创建资源目录
102
+ mkdir -p public/assets
103
+
104
+ # 复制资源文件
105
+ cp -r node_modules/wechat-emojis/assets/* public/assets/
106
+ ```
107
+
108
+ #### 方法二:使用构建脚本
109
+
110
+ 在你的 `package.json` 中添加:
111
+
112
+ ```json
113
+ {
114
+ "scripts": {
115
+ "postinstall": "mkdir -p public/assets && cp -r node_modules/wechat-emojis/assets/* public/assets/",
116
+ "build": "npm run copy-assets && react-scripts build",
117
+ "copy-assets": "mkdir -p public/assets && cp -r node_modules/wechat-emojis/assets/* public/assets/"
118
+ }
119
+ }
120
+ ```
121
+
122
+ #### 方法三:使用 webpack 配置
123
+
124
+ 如果你使用自定义 webpack 配置,可以添加:
125
+
126
+ ```javascript
127
+ // webpack.config.js
128
+ const CopyPlugin = require('copy-webpack-plugin');
129
+
130
+ module.exports = {
131
+ plugins: [
132
+ new CopyPlugin({
133
+ patterns: [
134
+ {
135
+ from: 'node_modules/wechat-emojis/assets',
136
+ to: 'assets'
137
+ }
138
+ ]
139
+ })
140
+ ]
141
+ };
142
+ ```
143
+
144
+ ## 🔧 TypeScript 支持
145
+
146
+ 包已包含完整的 TypeScript 类型定义,你可以享受完整的类型检查和智能提示:
147
+
148
+ ```typescript
149
+ import { EmojiName, EmojiCategory } from 'wechat-emojis';
150
+
151
+ // 类型安全的表情名称
152
+ const emojiName: EmojiName = '微笑'; // ✅ 正确
153
+ const invalidName: EmojiName = '不存在的表情'; // ❌ TypeScript 错误
154
+
155
+ // 枚举类型
156
+ const category: EmojiCategory = EmojiCategory.FACE;
157
+ ```
158
+
159
+ ## 📱 在其他框架中使用
160
+
161
+ ### Vue.js
162
+
163
+ ```vue
164
+ <template>
165
+ <div>
166
+ <img :src="getEmojiPath('微笑')" alt="微笑" width="24" height="24" />
167
+ </div>
168
+ </template>
169
+
170
+ <script>
171
+ import { getEmojiPath } from 'wechat-emojis';
172
+
173
+ export default {
174
+ methods: {
175
+ getEmojiPath
176
+ }
177
+ };
178
+ </script>
179
+ ```
180
+
181
+ ### Angular
182
+
183
+ ```typescript
184
+ // emoji.service.ts
185
+ import { Injectable } from '@angular/core';
186
+ import { getEmojiPath, getEmojisByCategory, EmojiCategory } from 'wechat-emojis';
187
+
188
+ @Injectable({
189
+ providedIn: 'root'
190
+ })
191
+ export class EmojiService {
192
+ getEmojiPath = getEmojiPath;
193
+ getEmojisByCategory = getEmojisByCategory;
194
+ EmojiCategory = EmojiCategory;
195
+ }
196
+ ```
197
+
198
+ ```html
199
+ <!-- emoji.component.html -->
200
+ <img [src]="emojiService.getEmojiPath('微笑')" alt="微笑" width="24" height="24">
201
+ ```
202
+
203
+ ## 🎯 最佳实践
204
+
205
+ 1. **预加载常用表情**:在应用启动时预加载常用表情图片
206
+ 2. **懒加载**:对于大量表情,考虑使用懒加载
207
+ 3. **缓存**:利用浏览器缓存机制,避免重复加载
208
+ 4. **错误处理**:始终检查 `getEmojiPath` 的返回值
209
+ 5. **性能优化**:使用 `React.memo` 或类似优化手段避免不必要的重渲染
210
+
211
+ ## 🐛 常见问题
212
+
213
+ ### Q: 表情图片显示不出来?
214
+
215
+ A: 确保已将 assets 目录复制到项目的 public 目录中。
216
+
217
+ ### Q: TypeScript 类型错误?
218
+
219
+ A: 确保安装了最新版本的包,并重启 TypeScript 服务。
220
+
221
+ ### Q: 如何自定义表情路径?
222
+
223
+ A: 你可以修改返回的路径,或者将图片复制到自定义目录。
@@ -58,16 +58,15 @@ const WeChatEmoji: React.FC<{name: EmojiName}> = ({ name }) => {
58
58
  mkdir -p src/utils/wechat-emojis
59
59
  mkdir -p public/assets
60
60
 
61
- # 复制TypeScript模块
62
- cp path/to/wechatEmoji.ts src/utils/wechat-emojis/
63
- cp path/to/wechatEmoji.js src/utils/wechat-emojis/
61
+ # 复制构建产物(npm 包内不含 src/,克隆仓库时可用 path/to/dist/index.js)
62
+ cp path/to/dist/index.js src/utils/wechat-emojis/
64
63
 
65
64
  # 复制表情资源到public目录
66
65
  cp -r path/to/assets/* public/assets/
67
66
  ```
68
67
 
69
68
  2. **调整图片路径**(重要):
70
- 由于React项目中public目录的资源访问方式,需要修改 `wechatEmoji.ts` 中的图片路径,将所有 `'assets/'` 替换为 `'/assets/'`。
69
+ 由于React项目中public目录的资源访问方式,需要修改复制过去的 `dist/index.js` 中的图片路径,将所有 `'assets/'` 替换为 `'/assets/'`。使用 npm 包时无需修改,包内的路径是 `assets/...`,直接拼到 `/` 后面即可(如上面的 `/${emojiPath}`)。
71
70
 
72
71
 
73
72
  ## 🚀 基础使用
package/package.json CHANGED
@@ -1,23 +1,29 @@
1
1
  {
2
2
  "name": "wechat-emojis",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "完整的微信内置表情资源库,包含 109 个高清 PNG 图片和类型安全的 TypeScript API",
5
- "main": "wechatEmoji.js",
6
- "types": "wechatEmoji.d.ts",
7
- "module": "wechatEmoji.js",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
8
7
  "files": [
9
- "wechatEmoji.js",
10
- "wechatEmoji.ts",
11
- "wechatEmoji.d.ts",
12
- "assets/**/*",
13
- "README.md",
14
- "API.md",
15
- "REACT_USAGE.md"
8
+ "dist/index.js",
9
+ "dist/index.d.ts",
10
+ "assets/**/*.png",
11
+ "docs/API.md",
12
+ "docs/NPM_USAGE.md",
13
+ "docs/REACT_USAGE.md",
14
+ "README.md"
16
15
  ],
17
16
  "scripts": {
18
17
  "build": "tsc",
19
- "prepublishOnly": "npm run build",
20
- "test": "echo \"Error: no test specified\" && exit 1"
18
+ "typecheck": "tsc --noEmit",
19
+ "typecheck:scripts": "tsc -p tsconfig.scripts.json",
20
+ "verify:assets": "node scripts/verify-assets.ts",
21
+ "typecheck:examples": "tsc --noEmit --target es2017 --module commonjs --moduleResolution node --strict examples/typescript/example.ts",
22
+ "test": "npm run build && npm run typecheck:scripts && npm run typecheck:examples && npm run verify:assets && npm run check:package",
23
+ "build:site": "node scripts/build-site.ts",
24
+ "check:site": "node scripts/check-site.ts",
25
+ "check:package": "node scripts/check-package.ts",
26
+ "prepare": "node scripts/prepare.ts"
21
27
  },
22
28
  "keywords": [
23
29
  "wechat",
@@ -39,9 +45,11 @@
39
45
  "bugs": {
40
46
  "url": "https://github.com/xxk8/wechat-emojis/issues"
41
47
  },
42
- "homepage": "https://github.com/xxk8/wechat-emojis#readme",
48
+ "homepage": "https://xxk8.github.io/wechat-emojis/",
43
49
  "devDependencies": {
44
- "typescript": "^5.0.0"
50
+ "@types/node": "^22.20.5",
51
+ "esbuild": "^0.28.2",
52
+ "typescript": "^5.9.2"
45
53
  },
46
54
  "engines": {
47
55
  "node": ">=14.0.0"
Binary file