flower-trellis 0.6.13-beta.15 → 0.6.13-beta.16
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flower-trellis",
|
|
3
|
-
"version": "0.6.13-beta.
|
|
3
|
+
"version": "0.6.13-beta.16",
|
|
4
4
|
"description": "一键安装/升级 Trellis 并自动融合 skill-garden 强化包(默认 Claude + agents)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"commit-and-tag-version": "^12.7.3"
|
|
74
74
|
},
|
|
75
75
|
"flowerReleaseNotes": {
|
|
76
|
-
"version": "0.6.13-beta.
|
|
76
|
+
"version": "0.6.13-beta.16",
|
|
77
77
|
"source": "CHANGELOG.md",
|
|
78
|
-
"body": "### 🐛 修复 Bug Fixes\n\n* **
|
|
78
|
+
"body": "### 🐛 修复 Bug Fixes\n\n* **update:** 升级快照排除运行时资料并前置范围判定 ([2cdc2de](https://github.com/SilentFlower/flower-trellis/commit/2cdc2de7233ed17aff3b84af9f5e85a720fccfec))",
|
|
79
79
|
"truncated": false
|
|
80
80
|
},
|
|
81
81
|
"optionalDependencies": {
|
|
@@ -36,7 +36,7 @@ function validateRelativePath(relativePath) {
|
|
|
36
36
|
|
|
37
37
|
function isExcluded(relativePath, directory = false) {
|
|
38
38
|
const candidate = directory ? `${relativePath.replace(/\/$/, "")}/` : relativePath;
|
|
39
|
-
return shouldExcludeFromBackup(candidate);
|
|
39
|
+
return scopeContains(".trellis/.runtime", relativePath) || shouldExcludeFromBackup(candidate);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function assertOrdinaryRoot(projectRoot) {
|
|
@@ -120,12 +120,17 @@ function scanScopes(projectRoot, scopes, onFile, options = {}) {
|
|
|
120
120
|
scopeContains(scope, relativePath) || scopeContains(relativePath, scope)
|
|
121
121
|
));
|
|
122
122
|
|
|
123
|
-
function walk(absolutePath, relativePath) {
|
|
124
|
-
const
|
|
123
|
+
function walk(absolutePath, relativePath, knownStat) {
|
|
124
|
+
const excluded = isExcluded(relativePath, true);
|
|
125
|
+
// 排除范围保存用户资料和运行状态,应在读取节点属性前裁剪。
|
|
126
|
+
if (excluded && !isForced(relativePath)) return;
|
|
127
|
+
const stat = knownStat ?? fs.lstatSync(absolutePath);
|
|
125
128
|
if (stat.isSymbolicLink()) throw new Error(`Update 受管范围包含软链:${relativePath}`);
|
|
126
129
|
if (stat.isDirectory()) {
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
// 仅用于到达精确目标的已排除祖先目录不属于新增路径,补偿时应保留。
|
|
131
|
+
if (!excluded || forcedScopes.some((scope) => scopeContains(scope, relativePath))) {
|
|
132
|
+
entries.set(relativePath, { path: relativePath, kind: "directory", mode: stat.mode & 0o777 });
|
|
133
|
+
}
|
|
129
134
|
const children = fs.readdirSync(absolutePath, { withFileTypes: true })
|
|
130
135
|
.sort((left, right) => left.name.localeCompare(right.name));
|
|
131
136
|
for (const child of children) {
|
|
@@ -141,10 +146,22 @@ function scanScopes(projectRoot, scopes, onFile, options = {}) {
|
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
for (const scope of scopes) {
|
|
149
|
+
if (isExcluded(scope, true) && !isForced(scope)) continue;
|
|
144
150
|
if ([...entries.keys()].some((entry) => scope === entry || scope.startsWith(`${entry}/`))) continue;
|
|
145
151
|
const absolutePath = path.join(projectRoot, ...scope.split("/"));
|
|
146
|
-
|
|
147
|
-
|
|
152
|
+
// 精确路径也需要校验祖先,避免穿过默认未遍历的链接读取项目外资料。
|
|
153
|
+
let parent = projectRoot;
|
|
154
|
+
for (const segment of scope.split("/").slice(0, -1)) {
|
|
155
|
+
parent = path.join(parent, segment);
|
|
156
|
+
const stat = fs.lstatSync(parent, { throwIfNoEntry: false });
|
|
157
|
+
if (!stat) break;
|
|
158
|
+
if (stat.isSymbolicLink() || !stat.isDirectory()) {
|
|
159
|
+
throw new Error(`Update 父路径不是普通目录:${toPosix(path.relative(projectRoot, parent))}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const stat = fs.lstatSync(absolutePath, { throwIfNoEntry: false });
|
|
163
|
+
if (!stat) continue;
|
|
164
|
+
walk(absolutePath, scope, stat);
|
|
148
165
|
}
|
|
149
166
|
return [...entries.values()].sort((left, right) => left.path.localeCompare(right.path));
|
|
150
167
|
}
|