@lkzc19/dsh-workspace-virtual-groups 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +78 -2
- package/cordis.patch.yml +12 -0
- package/lib/client.js +1051 -0
- package/lib/client.js.map +7 -0
- package/lib/index.js +230 -0
- package/package.json +64 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zcol
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,79 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @lkzc19/dsh-workspace-virtual-groups
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
给 DSH 侧边栏的工作区列表加一层**手动虚拟分组**。项目仍在原目录,插件只改变显示归属和顺序。
|
|
4
|
+
|
|
5
|
+
## 功能
|
|
6
|
+
|
|
7
|
+
- 内置「默认」分组固定第一,不可重命名或删除。
|
|
8
|
+
- 新建、重命名、删除分组;删除后组内项目回到默认。
|
|
9
|
+
- 把项目行拖到分组标题上即可归组;拖分组标题可调整顺序。
|
|
10
|
+
- 分组标题的 `⋯` 菜单:添加工作区、重命名分组、删除分组。
|
|
11
|
+
- 官方「视图选项 → 分组方式」新增「按虚拟分组」;选择其他模式即回到官方分组。
|
|
12
|
+
- 分组和排序保存在插件自己的 JSON 中,不修改官方工作区数据。
|
|
13
|
+
|
|
14
|
+
## 安装
|
|
15
|
+
|
|
16
|
+
发布到 npm 后可以一行安装(包名带 `@lkzc19` scope,不占用公共命名空间):
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
dsh plugin --profile desktop add @lkzc19/dsh-workspace-virtual-groups
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`lib/` 是构建产物,不进仓库。从源码安装时先克隆并构建,再从本地目录安装:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
git clone https://github.com/lkzc19/dsh-workspace-virtual-groups.git
|
|
26
|
+
cd dsh-workspace-virtual-groups
|
|
27
|
+
npm install # prepare 会自动执行 npm run build
|
|
28
|
+
|
|
29
|
+
# 桌面端
|
|
30
|
+
dsh plugin --profile desktop add "$PWD"
|
|
31
|
+
|
|
32
|
+
# Web / CLI
|
|
33
|
+
dsh plugin --profile web add "$PWD"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
安装后重启桌面端或对应的 `dsh web` 进程。
|
|
37
|
+
|
|
38
|
+
> 不要从 GitHub URL 直接安装(`dsh plugin add https://github.com/...`):pnpm 会拒绝为 git 依赖执行 `prepare`(`ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`),装进来的是一份没有 `lib/` 的源码。
|
|
39
|
+
|
|
40
|
+
卸载:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
dsh plugin --profile desktop remove @lkzc19/dsh-workspace-virtual-groups
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 使用
|
|
47
|
+
|
|
48
|
+
1. 打开侧边栏「工作区」区域。
|
|
49
|
+
2. 点击标题栏的「新建分组」创建分组。
|
|
50
|
+
3. 把项目行拖到分组标题上完成归类。
|
|
51
|
+
4. 需要回到官方分组时,在「视图选项 → 分组方式」选择「按工作区」「按工作区树」或「单列表」;再选「按虚拟分组」即可切回。
|
|
52
|
+
|
|
53
|
+
## 数据
|
|
54
|
+
|
|
55
|
+
手动分组、归属、排序和视图模式保存在:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
$DSH_HOME/workspace-virtual-groups.manual.json
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 兼容性
|
|
62
|
+
|
|
63
|
+
- 面向 DSH 0.2.x,桌面端和 `dsh web` 共用同一套代码。
|
|
64
|
+
- 插件依赖官方侧边栏的 DOM 结构;DSH 大版本升级后如果结构变化,插件会退化为不分组,不会破坏官方数据。
|
|
65
|
+
- 桌面端和 Web 端使用不同的 profile,需要分别安装。
|
|
66
|
+
|
|
67
|
+
## 开发
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
npm install # 装依赖并自动构建(prepare)
|
|
71
|
+
npm run build
|
|
72
|
+
npm test
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`lib/index.js`(Host)和 `lib/client.js`(Client)是构建产物,已被 `.gitignore` 忽略,不要提交。
|
|
76
|
+
|
|
77
|
+
## 许可证
|
|
78
|
+
|
|
79
|
+
MIT。基于 [z-col/dsh-workspace-groups](https://github.com/z-col/dsh-workspace-groups)(MIT)修改。完整许可见 [LICENSE](./LICENSE)。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# dsh-workspace-virtual-groups bundle patch.
|
|
2
|
+
#
|
|
3
|
+
# Installed through the official CLI:
|
|
4
|
+
#
|
|
5
|
+
# dsh plugin --profile web add /absolute/path/to/dsh-workspace
|
|
6
|
+
#
|
|
7
|
+
# The CLI appends this package to `dsh.profile.bundles`; the profile boot then
|
|
8
|
+
# merges this patch (one insert of the plugin row).
|
|
9
|
+
- insert:
|
|
10
|
+
- id: workspace-virtual-groups
|
|
11
|
+
name: '@lkzc19/dsh-workspace-virtual-groups'
|
|
12
|
+
config: {}
|