@lmy54321/design-system 1.3.12 → 1.3.14
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/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/scripts/init.mjs +26 -12
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -3740,7 +3740,7 @@ function GridSystemDocs() {
|
|
|
3740
3740
|
}
|
|
3741
3741
|
|
|
3742
3742
|
// index.ts
|
|
3743
|
-
var VERSION = "1.3.
|
|
3743
|
+
var VERSION = "1.3.14";
|
|
3744
3744
|
|
|
3745
3745
|
export { ActionSheet, BottomActionButtons, BottomNavigationBar, BottomSheet, BottomSheetOption, BottomSheetShareItem, BottomToolbar, Btn, BubbleTip, CardDemo, DRAWER_STATES, Dialog, DraggablePanel, EmptyState, GridSystemDocs, ICON_GROUPS, ICON_NAMES, IcExpand, IcPlan, IconFont, IconGallery, ImageWithFallback, Loading, NewsItem, NotificationBar, POIListItem, PoiItem, Push, SearchBox, SegmentedControl, StatGrid, Switch, Tag, TencentMap, Toast, TopToolbar, TypographyDocs, VERSION, cn, hasFilledVariant };
|
|
3746
3746
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
package/scripts/init.mjs
CHANGED
|
@@ -16,14 +16,17 @@ const cwd = process.cwd();
|
|
|
16
16
|
const execOptions = {
|
|
17
17
|
cwd,
|
|
18
18
|
stdio: 'pipe',
|
|
19
|
-
encoding: 'utf-8'
|
|
19
|
+
encoding: 'utf-8',
|
|
20
|
+
maxBuffer: 10 * 1024 * 1024 // 增加缓冲区到 10MB,防止超时
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
console.log('\n🚀 @lmy54321/design-system
|
|
23
|
-
console.log(`📂 初始化位置: ${cwd}
|
|
23
|
+
console.log('\n🚀 @lmy54321/design-system 项目初始化(完全自动化,无需交互)\n');
|
|
24
|
+
console.log(`📂 初始化位置: ${cwd}`);
|
|
25
|
+
console.log('⏳ 这个过程会自动完成,包括:创建项目、安装依赖、启动开发服务器\n');
|
|
26
|
+
|
|
24
27
|
|
|
25
28
|
// ============================================================
|
|
26
|
-
// 步骤 0:
|
|
29
|
+
// 步骤 0: 目录检查(不删除任何文件,让 Vite 处理冲突)
|
|
27
30
|
// ============================================================
|
|
28
31
|
|
|
29
32
|
console.log('🔍 检查目录状态...');
|
|
@@ -33,12 +36,7 @@ try {
|
|
|
33
36
|
);
|
|
34
37
|
|
|
35
38
|
if (files.length > 0) {
|
|
36
|
-
console.log('
|
|
37
|
-
for (const file of files) {
|
|
38
|
-
const filePath = resolve(cwd, file);
|
|
39
|
-
rmSync(filePath, { recursive: true, force: true });
|
|
40
|
-
}
|
|
41
|
-
console.log('✅ 目录已清理\n');
|
|
39
|
+
console.log('✅ 目录非空,将覆盖已有文件\n');
|
|
42
40
|
} else {
|
|
43
41
|
console.log('✅ 目录为空\n');
|
|
44
42
|
}
|
|
@@ -53,7 +51,19 @@ try {
|
|
|
53
51
|
|
|
54
52
|
console.log('📦 步骤 1/5: 创建 Vite 项目...');
|
|
55
53
|
try {
|
|
56
|
-
|
|
54
|
+
// 如果是非空目录,先删除可能冲突的 Vite 默认文件
|
|
55
|
+
const conflictFiles = ['src', 'public', 'index.html', 'vite.config.ts', 'tsconfig.json', 'package.json'];
|
|
56
|
+
for (const file of conflictFiles) {
|
|
57
|
+
const filePath = resolve(cwd, file);
|
|
58
|
+
if (existsSync(filePath)) {
|
|
59
|
+
rmSync(filePath, { recursive: true, force: true });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
execSync('npm create vite@latest . -- --template react-ts --yes', {
|
|
64
|
+
...execOptions,
|
|
65
|
+
timeout: 120000 // 2 分钟
|
|
66
|
+
});
|
|
57
67
|
console.log('✅ Vite 项目已创建\n');
|
|
58
68
|
} catch (error) {
|
|
59
69
|
console.error('❌ 创建 Vite 项目失败:', error.message);
|
|
@@ -66,7 +76,11 @@ try {
|
|
|
66
76
|
|
|
67
77
|
console.log('📦 步骤 2/5: 安装依赖...');
|
|
68
78
|
try {
|
|
69
|
-
|
|
79
|
+
// 设置更长的超时时间(10分钟),因为 npm install 可能需要时间
|
|
80
|
+
execSync('npm install && npm install @lmy54321/design-system tailwindcss @tailwindcss/vite react-router-dom motion', {
|
|
81
|
+
...execOptions,
|
|
82
|
+
timeout: 600000 // 10 分钟
|
|
83
|
+
});
|
|
70
84
|
console.log('✅ 依赖安装完成\n');
|
|
71
85
|
} catch (error) {
|
|
72
86
|
console.error('❌ 依赖安装失败:', error.message);
|