uxos 0.0.25 → 0.0.27
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/README.md +57 -5
- package/cli.js +62 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,16 +4,41 @@ UXOS - 设计效率助手:一个由 AI 驱动的、具有引导式工作流的
|
|
|
4
4
|
|
|
5
5
|
## 安装方法
|
|
6
6
|
|
|
7
|
-
**⭐
|
|
7
|
+
**⭐ 必须使用 @latest 标签**:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npx uxos@latest
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
>
|
|
14
|
-
>
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
> ❌ **不要使用** `npx uxos`(会使用缓存的旧版本)
|
|
14
|
+
> ✅ **必须使用** `npx uxos@latest`(始终获取最新版本)
|
|
15
|
+
|
|
16
|
+
### 为什么必须使用 @latest?
|
|
17
|
+
|
|
18
|
+
npx 会优先使用缓存的旧版本,导致:
|
|
19
|
+
- 创建错误的文件夹(`config/`, `workflows/`)
|
|
20
|
+
- 缺少必要的文件
|
|
21
|
+
- 安装失败
|
|
22
|
+
|
|
23
|
+
使用 `@latest` 可以:
|
|
24
|
+
- ✅ 强制下载最新版本
|
|
25
|
+
- ✅ 跳过缓存
|
|
26
|
+
- ✅ 确保正确安装
|
|
27
|
+
|
|
28
|
+
### 正确用法
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# ✅ 推荐:使用 @latest
|
|
32
|
+
npx uxos@latest
|
|
33
|
+
|
|
34
|
+
# ✅ 或指定具体版本号
|
|
35
|
+
npx uxos@0.0.25
|
|
36
|
+
|
|
37
|
+
# ❌ 错误:不要直接使用(会用缓存)
|
|
38
|
+
npx uxos
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
> ⚠️ **注意拼写**:是 `latest`(不是 `lastest`)
|
|
17
42
|
|
|
18
43
|
**方法一:通过 AI 助手安装**
|
|
19
44
|
|
|
@@ -55,6 +80,33 @@ npx uxos@latest
|
|
|
55
80
|
|
|
56
81
|
安装完成后,UXOS 会自动在工作目录创建 `_uxos/` 文件夹。AI 助手会引导你阅读初始化指南并开始使用。
|
|
57
82
|
|
|
83
|
+
## 故障排除
|
|
84
|
+
|
|
85
|
+
### 问题:出现 config/ 或 workflows/ 文件夹
|
|
86
|
+
|
|
87
|
+
**原因**:使用了缓存的旧版本(没有加 `@latest`)
|
|
88
|
+
|
|
89
|
+
**解决**:
|
|
90
|
+
```bash
|
|
91
|
+
# 1. 删除旧文件夹
|
|
92
|
+
rm -rf config/ workflows/ templates/
|
|
93
|
+
|
|
94
|
+
# 2. 清除缓存
|
|
95
|
+
npm cache clean --force
|
|
96
|
+
rm -rf ~/.npm/_npx
|
|
97
|
+
|
|
98
|
+
# 3. 使用 @latest 重新安装
|
|
99
|
+
npx uxos@latest
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 问题:提示版本不匹配
|
|
103
|
+
|
|
104
|
+
**解决**:始终使用 `@latest` 标签
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npx uxos@latest
|
|
108
|
+
```
|
|
109
|
+
|
|
58
110
|
## 功能特性
|
|
59
111
|
|
|
60
112
|
- **工作流系统**:产品设计和开发的引导式工作流
|
package/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ const VERSION = packageJson.version;
|
|
|
10
10
|
|
|
11
11
|
const UXOS_SRC_DIR = path.join(__dirname, '_uxos');
|
|
12
12
|
|
|
13
|
-
// Check if running the latest version
|
|
13
|
+
// CRITICAL: Check if running the latest version IMMEDIATELY
|
|
14
14
|
function checkForLatestVersion() {
|
|
15
15
|
try {
|
|
16
16
|
const latestVersion = execSync('npm view uxos version', { encoding: 'utf8', timeout: 3000 }).trim();
|
|
@@ -24,26 +24,33 @@ function checkForLatestVersion() {
|
|
|
24
24
|
You are running uxos@${VERSION}
|
|
25
25
|
The latest version is: uxos@${latestVersion}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
⚠️ IMPORTANT: Direct 'npx uxos' may use cached old versions!
|
|
28
|
+
|
|
29
|
+
SOLUTION: Always use @latest tag:
|
|
30
|
+
|
|
31
|
+
npx uxos@latest
|
|
32
|
+
|
|
33
|
+
Or clean cache first:
|
|
28
34
|
|
|
29
35
|
npm uninstall -g uxos
|
|
30
36
|
npm cache clean --force
|
|
31
37
|
rm -rf ~/.npm/_npx
|
|
32
38
|
npx uxos@latest
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
npx uxos@${latestVersion}
|
|
40
|
+
Visit: https://www.npmjs.com/package/uxos
|
|
37
41
|
|
|
38
42
|
`);
|
|
39
43
|
process.exit(1);
|
|
40
44
|
}
|
|
41
45
|
} catch (error) {
|
|
42
46
|
// If we can't check (no internet, etc.), continue anyway
|
|
43
|
-
console.log('⚠️ Unable to check for updates (network issue?)');
|
|
47
|
+
console.log('⚠️ Unable to check for updates (network issue?)\n');
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
// Check IMMEDIATELY before doing anything
|
|
52
|
+
checkForLatestVersion();
|
|
53
|
+
|
|
47
54
|
function createDirectory(dir) {
|
|
48
55
|
if (!fs.existsSync(dir)) {
|
|
49
56
|
fs.mkdirSync(dir, { recursive: true });
|
|
@@ -87,25 +94,66 @@ function main() {
|
|
|
87
94
|
return;
|
|
88
95
|
}
|
|
89
96
|
|
|
90
|
-
// Check
|
|
91
|
-
checkForLatestVersion();
|
|
92
|
-
|
|
93
|
-
// Check for old version structure and warn user
|
|
97
|
+
// Check for old version structure FIRST (before creating anything)
|
|
94
98
|
const oldWorkflowsDir = path.join(__dirname, 'workflows');
|
|
95
99
|
const oldTemplatesDir = path.join(__dirname, 'templates');
|
|
96
|
-
|
|
100
|
+
const oldConfigDir = path.join(__dirname, 'config');
|
|
101
|
+
|
|
102
|
+
if (fs.existsSync(oldWorkflowsDir) || fs.existsSync(oldTemplatesDir) || fs.existsSync(oldConfigDir)) {
|
|
97
103
|
console.log(`
|
|
98
104
|
╔═══════════════════════════════════════════════════════════╗
|
|
99
|
-
║
|
|
105
|
+
║ ⚠️ OLD VERSION STRUCTURE DETECTED ║
|
|
100
106
|
╚═══════════════════════════════════════════════════════════╝
|
|
101
107
|
|
|
102
|
-
This
|
|
108
|
+
This is an old version (0.0.21 or earlier).
|
|
109
|
+
|
|
110
|
+
⚠️ CRITICAL: You are using a CACHED old version!
|
|
103
111
|
|
|
104
|
-
|
|
112
|
+
The old version may have created these folders:
|
|
113
|
+
- config/
|
|
114
|
+
- workflows/
|
|
115
|
+
- templates/
|
|
116
|
+
|
|
117
|
+
SOLUTION: Always use @latest to avoid cache:
|
|
118
|
+
|
|
119
|
+
npx uxos@latest
|
|
120
|
+
|
|
121
|
+
Or clean up:
|
|
105
122
|
|
|
106
123
|
npm uninstall -g uxos
|
|
107
124
|
npm cache clean --force
|
|
108
125
|
rm -rf ~/.npm/_npx
|
|
126
|
+
|
|
127
|
+
Then delete old folders in your project:
|
|
128
|
+
rm -rf config/ workflows/ templates/
|
|
129
|
+
|
|
130
|
+
Then run:
|
|
131
|
+
npx uxos@latest
|
|
132
|
+
|
|
133
|
+
`);
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const projectRoot = process.cwd();
|
|
138
|
+
|
|
139
|
+
// Check if old folders exist in project directory
|
|
140
|
+
const projectOldWorkflows = path.join(projectRoot, 'workflows');
|
|
141
|
+
const projectOldConfig = path.join(projectRoot, 'config');
|
|
142
|
+
|
|
143
|
+
if (fs.existsSync(projectOldWorkflows) || fs.existsSync(projectOldConfig)) {
|
|
144
|
+
console.log(`
|
|
145
|
+
╔═══════════════════════════════════════════════════════════╗
|
|
146
|
+
║ ⚠️ OLD UXOS FILES DETECTED IN PROJECT ║
|
|
147
|
+
╚═══════════════════════════════════════════════════════════╝
|
|
148
|
+
|
|
149
|
+
Found old UXOS files from version 0.0.21 or earlier:
|
|
150
|
+
${fs.existsSync(projectOldWorkflows) ? ' ✗ workflows/\n' : ''}${fs.existsSync(projectOldConfig) ? ' ✗ config/\n' : ''}
|
|
151
|
+
Please remove these folders before installing:
|
|
152
|
+
|
|
153
|
+
rm -rf workflows/ config/ templates/
|
|
154
|
+
|
|
155
|
+
Then run:
|
|
156
|
+
|
|
109
157
|
npx uxos@latest
|
|
110
158
|
|
|
111
159
|
`);
|
|
@@ -121,7 +169,6 @@ Please uninstall and reinstall:
|
|
|
121
169
|
Installing UXOS workflow system...
|
|
122
170
|
`);
|
|
123
171
|
|
|
124
|
-
const projectRoot = process.cwd();
|
|
125
172
|
const uxosDestDir = path.join(projectRoot, '_uxos');
|
|
126
173
|
|
|
127
174
|
// Copy entire _uxos directory
|