@maiyunnet/kebab 9.3.10 → 9.3.11

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/doc/kebab-rag.md CHANGED
@@ -1360,7 +1360,7 @@ index/variables/VER.md
1360
1360
 
1361
1361
  # Variable: VER
1362
1362
 
1363
- > `const` **VER**: `"9.3.10"` = `'9.3.10'`
1363
+ > `const` **VER**: `"9.3.11"` = `'9.3.11'`
1364
1364
 
1365
1365
  Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
1366
1366
 
package/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * --- 本文件用来定义每个目录实体地址的常量 ---
6
6
  */
7
7
  /** --- 当前系统版本号 --- */
8
- export declare const VER = "9.3.10";
8
+ export declare const VER = "9.3.11";
9
9
  /** --- 框架根目录,以 / 结尾 --- */
10
10
  export declare const ROOT_PATH: string;
11
11
  /** --- 框架的 LIB,以 / 结尾 --- */
package/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * --- 本文件用来定义每个目录实体地址的常量 ---
7
7
  */
8
8
  /** --- 当前系统版本号 --- */
9
- export const VER = '9.3.10';
9
+ export const VER = '9.3.11';
10
10
  // --- 服务端用的路径 ---
11
11
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
12
12
  /** --- /xxx/xxx --- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "9.3.10",
3
+ "version": "9.3.11",
4
4
  "description": "Simple, easy-to-use, and fully-featured Node.js framework that is ready-to-use out of the box.",
5
5
  "type": "module",
6
6
  "keywords": [
package/sys/master.js CHANGED
@@ -327,6 +327,8 @@ function createRpcListener() {
327
327
  const cgaLockedDirs = new Set();
328
328
  /** --- 含有 kebab.json 的目录路径集合(不含开头/,含尾部/,根目录为空字符串) --- */
329
329
  const kebabProjectDirs = new Set();
330
+ /** --- 本次部署涉及到的目录路径集合(不含开头/,含尾部/,根目录为空字符串) --- */
331
+ const touchedDirs = new Set();
330
332
  for (const scanPath in ls) {
331
333
  /** --- 带 / 开头的 zip 中文件完整路径,例如 "/www/pika/stc/index.ts" --- */
332
334
  const scanFpath = scanPath.startsWith('/') ? scanPath : '/' + scanPath;
@@ -336,6 +338,7 @@ function createRpcListener() {
336
338
  const scanPat = scanFpath.slice(1, scanLio + 1);
337
339
  /** --- 纯文件名,例如 "index.ts" 或 "pika.cga" --- */
338
340
  const scanFname = scanFpath.slice(scanLio + 1);
341
+ touchedDirs.add(scanPat);
339
342
  if (scanFname.endsWith('.cga')) {
340
343
  // --- 记录 .cga 锁定的同级目录(去掉 .cga 后缀的名字即为被锁定的目录名)---
341
344
  cgaLockedDirs.add(scanPat + scanFname.slice(0, -4) + '/');
@@ -345,6 +348,22 @@ function createRpcListener() {
345
348
  kebabProjectDirs.add(scanPat);
346
349
  }
347
350
  }
351
+ // --- 补充扫描目标目录中现存的 kebab.json,兼容压缩包未携带 kebab.json 的情况 ---
352
+ for (const dir of touchedDirs) {
353
+ /** --- 目录逐级向上回溯时的累积路径列表,优先检查当前目录,再检查父级目录 --- */
354
+ const dirs = dir ? dir.split('/').filter(Boolean) : [];
355
+ for (let i = dirs.length; i >= 0; --i) {
356
+ /** --- 当前要检查的目录路径,不含开头/,含尾部/,根目录为空字符串 --- */
357
+ const currentDir = i ? dirs.slice(0, i).join('/') + '/' : '';
358
+ if (kebabProjectDirs.has(currentDir)) {
359
+ break;
360
+ }
361
+ if (await lFs.isFile(`${to}${currentDir}kebab.json`)) {
362
+ kebabProjectDirs.add(currentDir);
363
+ break;
364
+ }
365
+ }
366
+ }
348
367
  /** --- kebab 子项目中仅允许部署的子文件夹名集合 --- */
349
368
  const KEBAB_ALLOWED_DIRS = new Set(['ctr', 'data', 'stc', 'view', 'lib']);
350
369
  /** --- 常见开发、依赖、缓存、构建产物目录不参与部署 --- */