zixulu 1.79.2 → 1.79.3
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 +99 -99
- package/dist/index.js +117 -65
- package/dist/index.js.map +1 -1
- package/dist/src/utils/getEditorExtensions.d.ts +11 -1
- package/dist/src/utils/syncEditorSetting.d.ts +6 -0
- package/package.json +1 -1
- package/src/utils/addTailwind.ts +21 -21
- package/src/utils/checkTailwind.ts +9 -9
- package/src/utils/checkType.ts +9 -9
- package/src/utils/clearDockerLog.ts +8 -8
- package/src/utils/download7Zip.ts +14 -14
- package/src/utils/downloadAnydesk.ts +14 -14
- package/src/utils/downloadChrome.ts +14 -14
- package/src/utils/downloadFirefox.ts +14 -14
- package/src/utils/downloadGit.ts +14 -14
- package/src/utils/downloadHoneyview.ts +9 -9
- package/src/utils/downloadNodeJS.ts +14 -14
- package/src/utils/downloadPeazip.ts +14 -14
- package/src/utils/downloadPotPlayer.ts +14 -14
- package/src/utils/downloadPowerToys.ts +14 -14
- package/src/utils/downloadVscode.ts +14 -14
- package/src/utils/getDependcy.ts +16 -16
- package/src/utils/getEditorExtensions.ts +28 -2
- package/src/utils/getPackageUpgradeVersion.ts +43 -43
- package/src/utils/getPackageVersionFromRange.ts +8 -8
- package/src/utils/getRelativePath.ts +11 -11
- package/src/utils/hasChangeNoCommit.ts +6 -6
- package/src/utils/isAsset.ts +26 -26
- package/src/utils/isShellProxy.ts +12 -12
- package/src/utils/isStableVersion.ts +3 -3
- package/src/utils/isUrl.ts +5 -5
- package/src/utils/next.ts +12 -12
- package/src/utils/replaceCommitAuthor.ts +57 -57
- package/src/utils/setBun.ts +10 -10
- package/src/utils/setEnv.ts +24 -24
- package/src/utils/sleep.ts +3 -3
- package/src/utils/sortPackageJson.ts +16 -16
- package/src/utils/sudoCommand.ts +17 -17
- package/src/utils/syncCursorExtToCode.ts +19 -6
- package/src/utils/syncEditorSetting.ts +72 -66
- package/src/utils/unique.ts +3 -3
- package/src/utils/vite.ts +15 -15
package/README.md
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
# Zixulu CLI
|
|
2
|
-
|
|
3
|
-
一个功能丰富的前端开发工具集。
|
|
4
|
-
|
|
5
|
-
## 使用说明
|
|
6
|
-
|
|
7
|
-
### 项目初始化相关
|
|
8
|
-
|
|
9
|
-
- `zixulu init` - 初始化项目
|
|
10
|
-
- `zixulu eslint` - 删除 ESLint 相关配置
|
|
11
|
-
- `zixulu prettier` - 添加 prettier 配置
|
|
12
|
-
- `zixulu gitignore` - 添加 .gitignore 配置
|
|
13
|
-
|
|
14
|
-
### 构建工具配置
|
|
15
|
-
|
|
16
|
-
- `zixulu vite` - 初始化 vite 配置
|
|
17
|
-
- `zixulu rsbuild` - 初始化 rsbuild 配置
|
|
18
|
-
- `zixulu next` - 初始化 next 配置
|
|
19
|
-
- `zixulu father` (别名: `fs`) - 初始化 father 项目配置
|
|
20
|
-
- `zixulu rollup` - rollup 打包配置
|
|
21
|
-
|
|
22
|
-
### 样式工具
|
|
23
|
-
|
|
24
|
-
- `zixulu tailwind` - 添加 tailwind 配置
|
|
25
|
-
- `zixulu tailwind-patch` (别名: `tp`) - 应用 tailwind 补丁
|
|
26
|
-
- `zixulu antd` - 添加 antd 配置
|
|
27
|
-
|
|
28
|
-
### 依赖管理
|
|
29
|
-
|
|
30
|
-
- `zixulu upgrade-dependency` (别名: `ud`) - 升级项目依赖
|
|
31
|
-
- `zixulu upgrade-workspace-dependency` (别名: `uwd`) - 升级工作区项目依赖
|
|
32
|
-
- `zixulu registry` - 设置 npm registry
|
|
33
|
-
- `zixulu reinstall` (别名: `ri`) - 重新安装依赖
|
|
34
|
-
- `zixulu pnpm` - 设置 pnpm 配置
|
|
35
|
-
- `zixulu remove-lock` (别名: `rl`) - 删除 lock 文件
|
|
36
|
-
|
|
37
|
-
### 代码转换
|
|
38
|
-
|
|
39
|
-
- `zixulu remove-comment <path>` - 删除文件注释
|
|
40
|
-
- `zixulu arrow-to-function` (别名: `a2f`) - 将箭头函数组件转换为函数组件
|
|
41
|
-
- `zixulu interface-to-type` (别名: `i2t`) - 将 interface 转换为 type
|
|
42
|
-
- `zixulu sort-package-json` (别名: `spj`) - 对 package.json 中的依赖进行排序
|
|
43
|
-
- `zixulu add-alias` (别名: `aa`) - 添加路径别名
|
|
44
|
-
- `zixulu replace-alias` (别名: `ra`) - 替换路径别名
|
|
45
|
-
|
|
46
|
-
### 开发工具
|
|
47
|
-
|
|
48
|
-
- `zixulu vscode` (别名: `vsc`) - 同步 VS Code 配置
|
|
49
|
-
- `zixulu kill-port <port>` - 根据端口号杀死进程
|
|
50
|
-
- `zixulu snippet <path>` (别名: `sn`) - 生成 vscode snippet
|
|
51
|
-
- `zixulu browserlistrc` (别名: `blr`) - 添加 browserlistrc 配置
|
|
52
|
-
- `zixulu tsc` - 运行类型检查
|
|
53
|
-
|
|
54
|
-
### 代理设置
|
|
55
|
-
|
|
56
|
-
- `zixulu git-proxy` (别名: `gp`) - 设置 git 代理
|
|
57
|
-
- `zixulu shell-proxy` (别名: `sp`) - 设置 Shell 代理
|
|
58
|
-
|
|
59
|
-
### 数据库相关
|
|
60
|
-
|
|
61
|
-
- `zixulu prisma` - 添加 prisma 配置
|
|
62
|
-
- `zixulu prisma-generate` (别名: `pg`) - 生成 prisma client
|
|
63
|
-
|
|
64
|
-
### Docker 相关
|
|
65
|
-
|
|
66
|
-
- `zixulu install-docker` (别名: `id`) - 安装 Docker
|
|
67
|
-
- `zixulu set-docker-registry` (别名: `sdr`) - 设置 Docker 镜像地址
|
|
68
|
-
|
|
69
|
-
### 其他工具
|
|
70
|
-
|
|
71
|
-
- `zixulu beta-version` (别名: `bv`) - 设置版本号
|
|
72
|
-
- `zixulu headers` - 将浏览器中直接复制的 headers 转换为对象
|
|
73
|
-
- `zixulu add-zip-dist` (别名: `azd`) - 添加将 dist 压缩的脚本
|
|
74
|
-
- `zixulu bun` - 设置 bun
|
|
75
|
-
- `zixulu add-sync` - 添加同步包脚本
|
|
76
|
-
|
|
77
|
-
## 选项
|
|
78
|
-
|
|
79
|
-
许多命令支持以下选项:
|
|
80
|
-
|
|
81
|
-
- `-r, --registry <registry>` - 指定 npm 源地址(npm/taobao/tencent)
|
|
82
|
-
- `-p, --proxy` - 是否使用代理
|
|
83
|
-
- 更多选项请查看具体命令的帮助信息
|
|
84
|
-
|
|
85
|
-
## 代理配置
|
|
86
|
-
|
|
87
|
-
如果需要配置代理,可以通过以下命令:
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
# 设置 Git 代理
|
|
91
|
-
zixulu gp
|
|
92
|
-
|
|
93
|
-
# 设置 Shell 代理
|
|
94
|
-
zixulu sp
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## License
|
|
98
|
-
|
|
99
|
-
MIT
|
|
1
|
+
# Zixulu CLI
|
|
2
|
+
|
|
3
|
+
一个功能丰富的前端开发工具集。
|
|
4
|
+
|
|
5
|
+
## 使用说明
|
|
6
|
+
|
|
7
|
+
### 项目初始化相关
|
|
8
|
+
|
|
9
|
+
- `zixulu init` - 初始化项目
|
|
10
|
+
- `zixulu eslint` - 删除 ESLint 相关配置
|
|
11
|
+
- `zixulu prettier` - 添加 prettier 配置
|
|
12
|
+
- `zixulu gitignore` - 添加 .gitignore 配置
|
|
13
|
+
|
|
14
|
+
### 构建工具配置
|
|
15
|
+
|
|
16
|
+
- `zixulu vite` - 初始化 vite 配置
|
|
17
|
+
- `zixulu rsbuild` - 初始化 rsbuild 配置
|
|
18
|
+
- `zixulu next` - 初始化 next 配置
|
|
19
|
+
- `zixulu father` (别名: `fs`) - 初始化 father 项目配置
|
|
20
|
+
- `zixulu rollup` - rollup 打包配置
|
|
21
|
+
|
|
22
|
+
### 样式工具
|
|
23
|
+
|
|
24
|
+
- `zixulu tailwind` - 添加 tailwind 配置
|
|
25
|
+
- `zixulu tailwind-patch` (别名: `tp`) - 应用 tailwind 补丁
|
|
26
|
+
- `zixulu antd` - 添加 antd 配置
|
|
27
|
+
|
|
28
|
+
### 依赖管理
|
|
29
|
+
|
|
30
|
+
- `zixulu upgrade-dependency` (别名: `ud`) - 升级项目依赖
|
|
31
|
+
- `zixulu upgrade-workspace-dependency` (别名: `uwd`) - 升级工作区项目依赖
|
|
32
|
+
- `zixulu registry` - 设置 npm registry
|
|
33
|
+
- `zixulu reinstall` (别名: `ri`) - 重新安装依赖
|
|
34
|
+
- `zixulu pnpm` - 设置 pnpm 配置
|
|
35
|
+
- `zixulu remove-lock` (别名: `rl`) - 删除 lock 文件
|
|
36
|
+
|
|
37
|
+
### 代码转换
|
|
38
|
+
|
|
39
|
+
- `zixulu remove-comment <path>` - 删除文件注释
|
|
40
|
+
- `zixulu arrow-to-function` (别名: `a2f`) - 将箭头函数组件转换为函数组件
|
|
41
|
+
- `zixulu interface-to-type` (别名: `i2t`) - 将 interface 转换为 type
|
|
42
|
+
- `zixulu sort-package-json` (别名: `spj`) - 对 package.json 中的依赖进行排序
|
|
43
|
+
- `zixulu add-alias` (别名: `aa`) - 添加路径别名
|
|
44
|
+
- `zixulu replace-alias` (别名: `ra`) - 替换路径别名
|
|
45
|
+
|
|
46
|
+
### 开发工具
|
|
47
|
+
|
|
48
|
+
- `zixulu vscode` (别名: `vsc`) - 同步 VS Code 配置
|
|
49
|
+
- `zixulu kill-port <port>` - 根据端口号杀死进程
|
|
50
|
+
- `zixulu snippet <path>` (别名: `sn`) - 生成 vscode snippet
|
|
51
|
+
- `zixulu browserlistrc` (别名: `blr`) - 添加 browserlistrc 配置
|
|
52
|
+
- `zixulu tsc` - 运行类型检查
|
|
53
|
+
|
|
54
|
+
### 代理设置
|
|
55
|
+
|
|
56
|
+
- `zixulu git-proxy` (别名: `gp`) - 设置 git 代理
|
|
57
|
+
- `zixulu shell-proxy` (别名: `sp`) - 设置 Shell 代理
|
|
58
|
+
|
|
59
|
+
### 数据库相关
|
|
60
|
+
|
|
61
|
+
- `zixulu prisma` - 添加 prisma 配置
|
|
62
|
+
- `zixulu prisma-generate` (别名: `pg`) - 生成 prisma client
|
|
63
|
+
|
|
64
|
+
### Docker 相关
|
|
65
|
+
|
|
66
|
+
- `zixulu install-docker` (别名: `id`) - 安装 Docker
|
|
67
|
+
- `zixulu set-docker-registry` (别名: `sdr`) - 设置 Docker 镜像地址
|
|
68
|
+
|
|
69
|
+
### 其他工具
|
|
70
|
+
|
|
71
|
+
- `zixulu beta-version` (别名: `bv`) - 设置版本号
|
|
72
|
+
- `zixulu headers` - 将浏览器中直接复制的 headers 转换为对象
|
|
73
|
+
- `zixulu add-zip-dist` (别名: `azd`) - 添加将 dist 压缩的脚本
|
|
74
|
+
- `zixulu bun` - 设置 bun
|
|
75
|
+
- `zixulu add-sync` - 添加同步包脚本
|
|
76
|
+
|
|
77
|
+
## 选项
|
|
78
|
+
|
|
79
|
+
许多命令支持以下选项:
|
|
80
|
+
|
|
81
|
+
- `-r, --registry <registry>` - 指定 npm 源地址(npm/taobao/tencent)
|
|
82
|
+
- `-p, --proxy` - 是否使用代理
|
|
83
|
+
- 更多选项请查看具体命令的帮助信息
|
|
84
|
+
|
|
85
|
+
## 代理配置
|
|
86
|
+
|
|
87
|
+
如果需要配置代理,可以通过以下命令:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# 设置 Git 代理
|
|
91
|
+
zixulu gp
|
|
92
|
+
|
|
93
|
+
# 设置 Shell 代理
|
|
94
|
+
zixulu sp
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -4383,21 +4383,32 @@ description:
|
|
|
4383
4383
|
throw error;
|
|
4384
4384
|
}
|
|
4385
4385
|
}
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4386
|
+
const EditorExtensionCommandMap = {
|
|
4387
|
+
Code: "code",
|
|
4388
|
+
Cursor: "cursor",
|
|
4389
|
+
Antigravity: "antigravity"
|
|
4390
|
+
};
|
|
4391
|
+
async function canGetEditorExtensions({ editor }) {
|
|
4392
|
+
const command = getEditorExtensionCommand({
|
|
4393
|
+
editor
|
|
4394
|
+
});
|
|
4395
|
+
try {
|
|
4396
|
+
await execAsync(`${command} --version`);
|
|
4397
|
+
return true;
|
|
4398
|
+
} catch {
|
|
4399
|
+
return false;
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
function getEditorExtensionCommand({ editor }) {
|
|
4403
|
+
return EditorExtensionCommandMap[editor];
|
|
4396
4404
|
}
|
|
4397
4405
|
async function getEditorExtensions({ source }) {
|
|
4398
4406
|
let data = [];
|
|
4399
4407
|
if ("Online" !== source) {
|
|
4400
|
-
const
|
|
4408
|
+
const command = getEditorExtensionCommand({
|
|
4409
|
+
editor: source
|
|
4410
|
+
});
|
|
4411
|
+
const output = await execAsync(`${command} --list-extensions`);
|
|
4401
4412
|
data = output.split("\n").map((item)=>item.trim()).filter(Boolean);
|
|
4402
4413
|
} else {
|
|
4403
4414
|
const response = await fetch("https://luzixu.geskj.com/extensions.json");
|
|
@@ -4406,6 +4417,30 @@ async function getEditorExtensions({ source }) {
|
|
|
4406
4417
|
data = data.filter((item)=>!item.startsWith("anysphere.") && "github.copilot" !== item && "github.copilot-chat" !== item);
|
|
4407
4418
|
return new Set(data);
|
|
4408
4419
|
}
|
|
4420
|
+
async function syncCursorExtToCode() {
|
|
4421
|
+
const canReadCursorExtensions = await canGetEditorExtensions({
|
|
4422
|
+
editor: "Cursor"
|
|
4423
|
+
});
|
|
4424
|
+
if (!canReadCursorExtensions) throw new Error("Cursor 命令不可用,无法读取扩展列表,请确认已安装并加入 PATH");
|
|
4425
|
+
const canReadCodeExtensions = await canGetEditorExtensions({
|
|
4426
|
+
editor: "Code"
|
|
4427
|
+
});
|
|
4428
|
+
if (!canReadCodeExtensions) throw new Error("Code 命令不可用,无法读取扩展列表,请确认已安装并加入 PATH");
|
|
4429
|
+
const cursorExts = await getEditorExtensions({
|
|
4430
|
+
source: "Cursor"
|
|
4431
|
+
});
|
|
4432
|
+
const vscodeExts = await getEditorExtensions({
|
|
4433
|
+
source: "Code"
|
|
4434
|
+
});
|
|
4435
|
+
const codeCommand = getEditorExtensionCommand({
|
|
4436
|
+
editor: "Code"
|
|
4437
|
+
});
|
|
4438
|
+
const installExts = cursorExts.difference(vscodeExts);
|
|
4439
|
+
for (const ext of installExts)await execAsync(`${codeCommand} --install-extension ${ext}`);
|
|
4440
|
+
const uninstallExts = vscodeExts.difference(cursorExts);
|
|
4441
|
+
for (const ext of uninstallExts)await execAsync(`${codeCommand} --uninstall-extension ${ext}`);
|
|
4442
|
+
consola.success("同步完成");
|
|
4443
|
+
}
|
|
4409
4444
|
function hasAntiGravity() {
|
|
4410
4445
|
const userDir = homedir();
|
|
4411
4446
|
const path = join(userDir, "AppData/Roaming/Antigravity");
|
|
@@ -4522,6 +4557,25 @@ async function syncEditorFile({ type, source: { value: sourceValue }, target: {
|
|
|
4522
4557
|
await writeFile(targetValue, code, "utf-8");
|
|
4523
4558
|
consola.success(`${targetValue} 同步完成`);
|
|
4524
4559
|
}
|
|
4560
|
+
async function syncEditorExtensions({ editor, sourceExtensions, targetExtensions }) {
|
|
4561
|
+
const command = getEditorExtensionCommand({
|
|
4562
|
+
editor
|
|
4563
|
+
});
|
|
4564
|
+
const installExtensions = sourceExtensions.difference(targetExtensions);
|
|
4565
|
+
for (const ext of installExtensions)try {
|
|
4566
|
+
console.log(`${command} --install-extension ${ext}`);
|
|
4567
|
+
await execAsync(`${command} --install-extension ${ext}`);
|
|
4568
|
+
} catch {
|
|
4569
|
+
console.error(`${ext} 安装失败`);
|
|
4570
|
+
}
|
|
4571
|
+
const uninstallExtensions = targetExtensions.difference(sourceExtensions);
|
|
4572
|
+
for (const ext of uninstallExtensions)try {
|
|
4573
|
+
console.log(`${command} --uninstall-extension ${ext}`);
|
|
4574
|
+
await execAsync(`${command} --uninstall-extension ${ext}`);
|
|
4575
|
+
} catch {
|
|
4576
|
+
console.error(`${ext} 卸载失败`);
|
|
4577
|
+
}
|
|
4578
|
+
}
|
|
4525
4579
|
async function syncEditorSetting() {
|
|
4526
4580
|
const setting = await readZixuluSetting();
|
|
4527
4581
|
const sourceChoices = [
|
|
@@ -4620,66 +4674,64 @@ async function syncEditorSetting() {
|
|
|
4620
4674
|
}
|
|
4621
4675
|
for (const config of configs)await syncEditorFile(config);
|
|
4622
4676
|
if (types.includes("extensions")) {
|
|
4623
|
-
const
|
|
4624
|
-
|
|
4625
|
-
});
|
|
4626
|
-
const cursorExtensions = await getEditorExtensions({
|
|
4627
|
-
source: "Cursor"
|
|
4628
|
-
});
|
|
4629
|
-
const antigravityExtensions = await getEditorExtensions({
|
|
4630
|
-
source: "Antigravity"
|
|
4631
|
-
});
|
|
4632
|
-
const onlineExtensions = await getEditorExtensions({
|
|
4677
|
+
const extensionMap = new Map();
|
|
4678
|
+
extensionMap.set("Online", await getEditorExtensions({
|
|
4633
4679
|
source: "Online"
|
|
4634
|
-
});
|
|
4635
|
-
|
|
4680
|
+
}));
|
|
4681
|
+
if ("Online" !== source) {
|
|
4682
|
+
const canReadSourceExtensions = await canGetEditorExtensions({
|
|
4683
|
+
editor: source
|
|
4684
|
+
});
|
|
4685
|
+
if (!canReadSourceExtensions) throw new Error(`${source} 命令不可用,无法读取扩展列表,请确认已安装并加入 PATH`);
|
|
4686
|
+
extensionMap.set(source, await getEditorExtensions({
|
|
4687
|
+
source
|
|
4688
|
+
}));
|
|
4689
|
+
}
|
|
4690
|
+
const sourceExtensions = extensionMap.get(source);
|
|
4636
4691
|
if (targets.includes("Code")) {
|
|
4637
|
-
const
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
}
|
|
4692
|
+
const canReadCodeExtensions = await canGetEditorExtensions({
|
|
4693
|
+
editor: "Code"
|
|
4694
|
+
});
|
|
4695
|
+
if (canReadCodeExtensions) {
|
|
4696
|
+
extensionMap.set("Code", await getEditorExtensions({
|
|
4697
|
+
source: "Code"
|
|
4698
|
+
}));
|
|
4699
|
+
await syncEditorExtensions({
|
|
4700
|
+
editor: "Code",
|
|
4701
|
+
sourceExtensions,
|
|
4702
|
+
targetExtensions: extensionMap.get("Code")
|
|
4703
|
+
});
|
|
4704
|
+
} else consola.warn("Code 命令不可用,已跳过 VS Code 扩展同步");
|
|
4651
4705
|
}
|
|
4652
4706
|
if (targets.includes("Cursor")) {
|
|
4653
|
-
const
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
}
|
|
4707
|
+
const canReadCursorExtensions = await canGetEditorExtensions({
|
|
4708
|
+
editor: "Cursor"
|
|
4709
|
+
});
|
|
4710
|
+
if (canReadCursorExtensions) {
|
|
4711
|
+
extensionMap.set("Cursor", await getEditorExtensions({
|
|
4712
|
+
source: "Cursor"
|
|
4713
|
+
}));
|
|
4714
|
+
await syncEditorExtensions({
|
|
4715
|
+
editor: "Cursor",
|
|
4716
|
+
sourceExtensions,
|
|
4717
|
+
targetExtensions: extensionMap.get("Cursor")
|
|
4718
|
+
});
|
|
4719
|
+
} else consola.warn("Cursor 命令不可用,已跳过 Cursor 扩展同步");
|
|
4667
4720
|
}
|
|
4668
4721
|
if (targets.includes("Antigravity")) {
|
|
4669
|
-
const
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
}
|
|
4722
|
+
const canReadAntigravityExtensions = await canGetEditorExtensions({
|
|
4723
|
+
editor: "Antigravity"
|
|
4724
|
+
});
|
|
4725
|
+
if (canReadAntigravityExtensions) {
|
|
4726
|
+
extensionMap.set("Antigravity", await getEditorExtensions({
|
|
4727
|
+
source: "Antigravity"
|
|
4728
|
+
}));
|
|
4729
|
+
await syncEditorExtensions({
|
|
4730
|
+
editor: "Antigravity",
|
|
4731
|
+
sourceExtensions,
|
|
4732
|
+
targetExtensions: extensionMap.get("Antigravity")
|
|
4733
|
+
});
|
|
4734
|
+
} else consola.warn("Antigravity 命令不可用,已跳过 Antigravity 扩展同步");
|
|
4683
4735
|
}
|
|
4684
4736
|
if (targets.includes("Online")) await writeFile(join(onlinePath, "static", "extensions.json"), JSON.stringify(Array.from(sourceExtensions), null, 4));
|
|
4685
4737
|
}
|