@maiyunnet/kebab 9.3.7 → 9.3.9

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.7"` = `'9.3.7'`
1363
+ > `const` **VER**: `"9.3.9"` = `'9.3.9'`
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.7";
8
+ export declare const VER = "9.3.9";
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.7';
9
+ export const VER = '9.3.9';
10
10
  // --- 服务端用的路径 ---
11
11
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
12
12
  /** --- /xxx/xxx --- */
package/lib/turnstile.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Date: 2025-6-11
4
4
  * Last: 2025-6-11 21:50:31
5
5
  */
6
- import * as tc from 'tencentcloud-sdk-nodejs';
6
+ import * as tcc from 'tencentcloud-sdk-nodejs';
7
7
  // --- 库和定义 ---
8
8
  import * as lUndici from '#kebab/lib/undici.js';
9
9
  import * as lText from '#kebab/lib/text.js';
@@ -40,7 +40,7 @@ export async function verify(ctr, opt) {
40
40
  }
41
41
  case EFACTORY.TENCENT: {
42
42
  // --- 腾讯云验证 ---
43
- const client = new tc.captcha.v20190722.Client({
43
+ const client = new tcc.captcha.v20190722.Client({
44
44
  'credential': {
45
45
  'secretId': config.turnstile['TENCENT'].sid,
46
46
  'secretKey': config.turnstile['TENCENT'].skey,
@@ -31,7 +31,7 @@ export declare class Response {
31
31
  /**
32
32
  * --- 获取响应读取流对象 ---
33
33
  */
34
- getStream(): (import("undici/types/readable").default & undici.Dispatcher.BodyMixin) | zlib.Gunzip | zlib.Inflate | zlib.BrotliDecompress | null;
34
+ getStream(): zlib.BrotliDecompress | zlib.Gunzip | zlib.Inflate | (import("undici/types/readable").default & undici.Dispatcher.BodyMixin) | null;
35
35
  /**
36
36
  * --- 获取原生响应读取流对象 ---
37
37
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "9.3.7",
3
+ "version": "9.3.9",
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": [
@@ -22,8 +22,8 @@
22
22
  "#kebab/*": "./*"
23
23
  },
24
24
  "dependencies": {
25
- "@aws-sdk/client-s3": "^3.1045.0",
26
- "@aws-sdk/lib-storage": "^3.1045.0",
25
+ "@aws-sdk/client-s3": "^3.1047.0",
26
+ "@aws-sdk/lib-storage": "^3.1047.0",
27
27
  "@litert/http-client": "^1.1.2",
28
28
  "@litert/mime": "^0.1.3",
29
29
  "@litert/redis": "^3.2.1",
@@ -48,17 +48,17 @@
48
48
  "pg": "^8.20.0",
49
49
  "react": "^19.2.6",
50
50
  "react-dom": "^19.2.6",
51
- "react-router-dom": "^7.15.0",
51
+ "react-router-dom": "^7.15.1",
52
52
  "ssh2": "^1.17.0",
53
53
  "svg-captcha": "^1.4.0",
54
- "tailwind-merge": "^3.5.0",
55
- "tencentcloud-sdk-nodejs": "^4.1.227",
56
- "undici": "^8.2.0"
54
+ "tailwind-merge": "^3.6.0",
55
+ "tencentcloud-sdk-nodejs": "^4.1.232",
56
+ "undici": "^8.3.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@litert/eslint-plugin-rules": "^0.3.1",
60
60
  "@types/ejs": "^3.1.5",
61
- "@types/node": "^25.6.2",
61
+ "@types/node": "^25.8.0",
62
62
  "@types/pg": "^8.20.0",
63
63
  "@types/react": "^19.2.14",
64
64
  "@types/react-dom": "^19.2.3",
package/sys/master.js CHANGED
@@ -186,10 +186,16 @@ function createRpcListener() {
186
186
  res.end('Path not found');
187
187
  return;
188
188
  }
189
- const rtn = await lCore.exec('npm i --omit=dev --omit=optional', {
189
+ let rtn = await lCore.exec('npm i --omit=dev --omit=optional', {
190
190
  'cwd': msg.path,
191
191
  });
192
- if (!rtn) {
192
+ if (rtn === false) {
193
+ // --- 部分项目可能存在 peerDependencies 冲突,失败后降级为 legacy-peer-deps 再试一次 ---
194
+ rtn = await lCore.exec('npm i --omit=dev --omit=optional --legacy-peer-deps', {
195
+ 'cwd': msg.path,
196
+ });
197
+ }
198
+ if (rtn === false) {
193
199
  res.end('Exec failed');
194
200
  return;
195
201
  }
@@ -224,7 +230,7 @@ function createRpcListener() {
224
230
  to += '/';
225
231
  }
226
232
  if (!await lFs.isDir(to)) {
227
- res.end('Path not found: ' + to);
233
+ res.end('[project] Path not found: ' + to);
228
234
  return;
229
235
  }
230
236
  const projectFile = to + 'kebab.json';
@@ -297,7 +303,7 @@ function createRpcListener() {
297
303
  }
298
304
  if (!await lFs.isDir(to)) {
299
305
  if (rtn.post['strict'] === '1') {
300
- res.end('Path not found: ' + to);
306
+ res.end(`[code][0] [${rtn.post['strict']}] Path not found: ${to}`);
301
307
  await sRoute.unlinkUploadFiles(rtn.files);
302
308
  return;
303
309
  }
@@ -341,6 +347,27 @@ function createRpcListener() {
341
347
  }
342
348
  /** --- kebab 子项目中仅允许部署的子文件夹名集合 --- */
343
349
  const KEBAB_ALLOWED_DIRS = new Set(['ctr', 'data', 'stc', 'view', 'lib']);
350
+ /** --- 常见开发、依赖、缓存、构建产物目录不参与部署 --- */
351
+ const DEPLOY_EXCLUDE_DIRS = new Set([
352
+ '.git',
353
+ '.svn',
354
+ '.hg',
355
+ '.vscode',
356
+ '.idea',
357
+ '.history',
358
+ 'node_modules',
359
+ 'bower_components',
360
+ '.cache',
361
+ '.parcel-cache',
362
+ '.turbo',
363
+ '.next',
364
+ '.nuxt',
365
+ '.vite',
366
+ 'coverage',
367
+ '.nyc_output',
368
+ 'tmp',
369
+ 'temp',
370
+ ]);
344
371
  for (const path in ls) {
345
372
  /** --- 带 / 开头的 zip 中文件完整路径,例如 "/www/pika/ctr/api.js" --- */
346
373
  const fpath = path.startsWith('/') ? path : '/' + path;
@@ -350,6 +377,10 @@ function createRpcListener() {
350
377
  const pat = fpath.slice(1, lio + 1);
351
378
  /** --- 纯文件名,例如 "api.js" --- */
352
379
  const fname = fpath.slice(lio + 1);
380
+ if (fpath.slice(1).split('/').slice(0, -1).some(seg => DEPLOY_EXCLUDE_DIRS.has(seg))) {
381
+ // --- 开发、依赖、缓存、构建产物目录不覆盖 ---
382
+ continue;
383
+ }
353
384
  if ((pat === 'conf/' && fname === 'config.json') || fname === 'kebab.json') {
354
385
  // --- 特殊文件不能覆盖 ---
355
386
  continue;
@@ -407,7 +438,7 @@ function createRpcListener() {
407
438
  // --- 看文件夹是否存在 ---
408
439
  if (pat && !await lFs.isDir(to + pat)) {
409
440
  if (rtn.post['strict'] === '1') {
410
- res.end('Path not found: ' + to + pat);
441
+ res.end(`[code][1] [${rtn.post['strict']}] Path not found: ${to + pat}`);
411
442
  await sRoute.unlinkUploadFiles(rtn.files);
412
443
  return;
413
444
  }
@@ -415,7 +446,7 @@ function createRpcListener() {
415
446
  }
416
447
  // --- 覆盖或创建文件 ---
417
448
  if ((rtn.post['strict'] === '1') && !await lFs.isFile(to + pat + fname)) {
418
- res.end('Path not found: ' + to + pat + fname);
449
+ res.end(`[code][2] [${rtn.post['strict']}] Path not found: ${to + pat + fname}`);
419
450
  await sRoute.unlinkUploadFiles(rtn.files);
420
451
  return;
421
452
  }