17 Commits

Author SHA1 Message Date
MK (fengmk2)
89f1250927 refactor: use all in one egg v4 (#855)
required https://github.com/eggjs/egg/pull/5654

---------

Signed-off-by: MK (fengmk2) <fengmk2@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-28 22:17:01 +08:00
MK (fengmk2)
e5162f20aa fix: improve TypeScript type definitions across codebase (#844)
This commit enhances type safety and fixes type-related issues
throughout the project including:
- Updated type definitions in entities, repositories, and models
- Improved type annotations in services and controllers
- Fixed type issues in adapters and utilities
- Enhanced test file type definitions
- Added typings/index.d.ts for global type declarations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-23 00:58:59 +08:00
MK (fengmk2)
c7df471c0e refactor: use tegg and egg v4 beta (#836)
🦀 for https://github.com/eggjs/egg/issues/3644
2025-10-06 14:48:45 +08:00
fengmk2
5d5f40ba26 chore: more oxlint rules (#774) 2025-03-18 00:38:32 +08:00
fengmk2
ffe723e65f refactor: use oxlint instead of eslint (#772)
say goodbye to eslint
2025-03-13 23:31:13 +08:00
fengmk2
0a64698ec0 refactor: use tegg v4 (#765) 2025-03-06 00:04:09 +08:00
fengmk2
4427a4fca5 feat: use egg v4 (#747)
BREAKING CHANGE: only support egg >= 4.0.0

the first app on egg v4

https://github.com/eggjs/egg/issues/3644
2025-02-09 15:43:24 +08:00
fengmk2
05301166a2 feat: add unpkg-white-list to detect sync unpkg files or not (#686)
see https://github.com/cnpm/unpkg-white-list

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **New Features**
- Introduced a new configuration option `enableSyncUnpkgFilesWhiteList`
to enhance package version file synchronization.

- **Improvements**
- Enhanced logging in package version file operations for better
traceability.
- Simplified file redirection logic for improved performance and
readability.

- **Tests**
- Added test cases for the new `enableSyncUnpkgFilesWhiteList`
configuration to ensure reliability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-05-18 13:11:22 +08:00
fengmk2
51cd044742 feat: enable sql logger (#460)
And fix registry error response cause data return null bug
2023-05-06 14:41:20 +08:00
elrrrrrrr
d7ae7aaaf2 feat: retry changes task when current work error (#414)
> 当前请求 changesStream 失败时,需等待 15 分钟超时调度。
* 原 suspendTaskWhenExit 重构为 suspendSync ,支持传入 exit 参数,控制是否继续等待
* 请求 changesStream 失败时,主动挂起任务

------

> Wait 15 minutes for timeout scheduling if the current request
changesStream fails
* `suspendTaskWhenExit` is refactored to `suspendSync`, add exit
parameter to control whether to exiting the queue
* Suspend task when request changesStream fails
2023-03-01 15:38:35 +08:00
elrrrrrrr
2c821eaa64 fix: changesStream suspend (#408)
> https://github.com/cnpm/cnpmcore/pull/367 tegg-v3 升级后,service 改为
Singleton,无法通过 ctx 上下文获取
* 修改 app 内 Service 获取方式
* 移除废弃的 typing.ts 声明

------------

> https://github.com/cnpm/cnpmcore/pull/367 Service has been refactored
to Singleton in tegg-v3 , which can't be inited with context anymore.
* Update Service init logic in appHook
* Remove the deprecated typing.ts


![image](https://user-images.githubusercontent.com/5574625/218919092-4a6b7353-7234-47f4-af99-9bf16846c2f1.png)
2023-02-15 13:37:12 +08:00
fengmk2
57515de719 🐛 FIX: Use runInAnonymousContextScope instead (#367) 2022-12-16 21:58:55 +08:00
elrrrrrrr
c562645db7 feat: suspend task before app close (#365)
> 机器计划内重启时,需要等待超时后再重新 retry 恢复 changesStream
同步,新增任务挂起机器,应用退出前,挂起当前机器正在执行的同步任务

* 新增 taskRepository#findTaskByAuthorIpAndType 方法,查找所有当前机器所有 worker 同步的任务
* 新增 module.d.ts 定义,目前仅消费 cnpmcoreCore module 内的 changesStream 方法
* app.ts 内调用 changesStreamService#suspendTaskWhenExit 在应用退出前触发

Co-authored-by: killa <killa123@126.com>
2022-12-15 21:34:24 +08:00
fengmk2
67cd0a92a6 👌 IMPROVE: Store total data to cache (#136) 2022-02-03 12:54:15 +08:00
fengmk2
427b9c7627 📦 NEW: Add binary index html (#105)
closes https://github.com/cnpm/cnpmcore/issues/84
2022-01-16 01:21:45 +08:00
fengmk2
a36f8d3479 📦 NEW: Support changes stream (#73)
closes https://github.com/cnpm/cnpmcore/issues/70
2021-12-26 22:15:26 +08:00
fengmk2
ffdfd0b232 📦 NEW: Show total data on home page request (#71)
* 📦 NEW: Show total data on home page request

```js
{
  last_pacakge: '@cnpm/home2',
  last_pacakge_version: '@cnpm/home1@1.0.1',
  doc_count: 2,
  doc_version_count: 3,
  download: {
    today: 3,
    yesterday: 1,
    thisweek: 4,
    thismonth: 5,
    thisyear: 6,
    lastweek: 1,
    lastmonth: 1,
    lastyear: 1
  },
  update_seq: 0,
  sync_model: 'none',
  sync_changes_steam: {},
  instance_start_time: '2021-12-25T03:33:40.845Z',
  node_version: 'v16.13.1',
  app_version: '0.0.2',
  engine: 'mysql'
}
```
2021-12-25 12:22:07 +08:00