uxos 0.0.23 → 0.0.25

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 (3) hide show
  1. package/README.md +30 -10
  2. package/cli.js +45 -10
  3. package/package.json +4 -2
package/README.md CHANGED
@@ -4,29 +4,49 @@ UXOS - 设计效率助手:一个由 AI 驱动的、具有引导式工作流的
4
4
 
5
5
  ## 安装方法
6
6
 
7
- **⚠️ 重要提示**:首次安装或更新时,请使用以下命令清除缓存:
7
+ **⭐ 推荐方式(始终使用最新版本)**:
8
8
 
9
9
  ```bash
10
- # 清除 npm 缓存
11
- npm cache clean --force
12
-
13
- # 删除 npx 缓存
14
- rm -rf ~/.npm/_npx
10
+ npx uxos@latest
15
11
  ```
16
12
 
13
+ > ⚠️ **重要提示**:
14
+ > - 必须加 `@latest` 以避免使用缓存的旧版本
15
+ > - 注意拼写:是 `latest`(不是 `lastest`)
16
+ > - 如果不加 `@latest`,可能会使用旧版本导致错误
17
+
17
18
  **方法一:通过 AI 助手安装**
18
19
 
19
- 在 CodeBuddy 的 AI 助手中输入以下指令:
20
+ 在 CodeBuddy 的 AI 助手中输入:
20
21
 
21
22
  ```
22
23
  帮我安装 npx uxos
23
24
  ```
24
25
 
25
- **方法二:命令行安装**
26
+ **方法二:命令行安装(推荐)**
27
+
28
+ ```bash
29
+ # 推荐:明确指定 @latest 确保使用最新版本
30
+ npx uxos@latest
31
+
32
+ # 或指定具体版本号
33
+ npx uxos@0.0.24
34
+ ```
35
+
36
+ ### ⚠️ 如果遇到旧版本问题
37
+
38
+ 如果之前安装过 uxos 并遇到错误,请运行:
26
39
 
27
40
  ```bash
28
- # 强制安装最新版本
29
- npx --yes uxos@latest
41
+ # 1. 卸载全局安装(如果有)
42
+ npm uninstall -g uxos
43
+
44
+ # 2. 清除缓存
45
+ npm cache clean --force
46
+ rm -rf ~/.npm/_npx
47
+
48
+ # 3. 使用最新版本
49
+ npx uxos@latest
30
50
  ```
31
51
 
32
52
  然后跟随 AI 助手的指引即可完成安装。
package/cli.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const { execSync } = require('child_process');
5
6
 
6
7
  // Read version from package.json
7
8
  const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
@@ -9,6 +10,40 @@ const VERSION = packageJson.version;
9
10
 
10
11
  const UXOS_SRC_DIR = path.join(__dirname, '_uxos');
11
12
 
13
+ // Check if running the latest version
14
+ function checkForLatestVersion() {
15
+ try {
16
+ const latestVersion = execSync('npm view uxos version', { encoding: 'utf8', timeout: 3000 }).trim();
17
+
18
+ if (latestVersion !== VERSION) {
19
+ console.log(`
20
+ ╔═══════════════════════════════════════════════════════════╗
21
+ ║ ⚠️ VERSION WARNING ║
22
+ ╚═══════════════════════════════════════════════════════════╝
23
+
24
+ You are running uxos@${VERSION}
25
+ The latest version is: uxos@${latestVersion}
26
+
27
+ Please run the following to use the latest version:
28
+
29
+ npm uninstall -g uxos
30
+ npm cache clean --force
31
+ rm -rf ~/.npm/_npx
32
+ npx uxos@latest
33
+
34
+ Or simply use:
35
+
36
+ npx uxos@${latestVersion}
37
+
38
+ `);
39
+ process.exit(1);
40
+ }
41
+ } catch (error) {
42
+ // If we can't check (no internet, etc.), continue anyway
43
+ console.log('⚠️ Unable to check for updates (network issue?)');
44
+ }
45
+ }
46
+
12
47
  function createDirectory(dir) {
13
48
  if (!fs.existsSync(dir)) {
14
49
  fs.mkdirSync(dir, { recursive: true });
@@ -52,27 +87,27 @@ function main() {
52
87
  return;
53
88
  }
54
89
 
90
+ // Check if we're running the latest version
91
+ checkForLatestVersion();
92
+
55
93
  // Check for old version structure and warn user
56
94
  const oldWorkflowsDir = path.join(__dirname, 'workflows');
57
95
  const oldTemplatesDir = path.join(__dirname, 'templates');
58
96
  if (fs.existsSync(oldWorkflowsDir) || fs.existsSync(oldTemplatesDir)) {
59
97
  console.log(`
60
- ═══════════════════════════════════════════════════════════
61
- ⚠️ WARNING: OLD VERSION DETECTED
62
- ═══════════════════════════════════════════════════════════
98
+ ╔═══════════════════════════════════════════════════════════╗
99
+ ⚠️ OLD VERSION STRUCTURE DETECTED
100
+ ╚═══════════════════════════════════════════════════════════╝
63
101
 
64
- You are using an outdated version of UXOS.
102
+ This appears to be an old version (0.0.21 or earlier).
65
103
 
66
- To update to the latest version, run:
104
+ Please uninstall and reinstall:
67
105
 
106
+ npm uninstall -g uxos
68
107
  npm cache clean --force
69
108
  rm -rf ~/.npm/_npx
70
- npx --yes uxos@latest
71
-
72
- Current version: OLD (0.0.21 or earlier)
73
- Latest version: 0.0.22+
109
+ npx uxos@latest
74
110
 
75
- For more information, visit: https://www.npmjs.com/package/uxos
76
111
  `);
77
112
  process.exit(1);
78
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uxos",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "UXOS - Design Efficiency Assistant: A guided workflow system for AI-powered design collaboration",
5
5
  "main": "cli.js",
6
6
  "bin": {
@@ -16,7 +16,8 @@
16
16
  "ai-assistant",
17
17
  "productivity",
18
18
  "ux",
19
- "collaboration"
19
+ "collaboration",
20
+ "npx"
20
21
  ],
21
22
  "author": "UXOS Team",
22
23
  "license": "MIT",
@@ -28,6 +29,7 @@
28
29
  "engines": {
29
30
  "node": ">=14.0.0"
30
31
  },
32
+ "preferGlobal": false,
31
33
  "files": [
32
34
  "cli.js",
33
35
  "package.json",