-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support npm search command like npmio #513
Conversation
需要添加一个配置项,默认不开启。 另外可能还需要类似 Auth,提供一个 adapter ,便于企业内自定义实现。 |
https://github.com/Beace/eggjs-elasticsearch 初步完成 egg es插件,采用 es8,最新版本 |
实测插件可用 import { Client as ElasticsearchClient } from '@elastic/elasticsearch';
class A {
@Inject()
private readonly elasticsearch: ElasticsearchClient;
} |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #513 +/- ##
==========================================
- Coverage 97.05% 96.93% -0.12%
==========================================
Files 175 180 +5
Lines 16792 17344 +552
Branches 2212 2249 +37
==========================================
+ Hits 16297 16813 +516
- Misses 495 531 +36
|
@Beace 继续搞完?写一下使用文档,我加一个 es 服务。 |
就这两天会搞完 |
还差点,周末赶完... |
@Beace 加油,新版 web 就等这个搜索能力了。 |
快了快了 |
已达可用状态,待补充单测 |
@Beace 有个反馈,修复一下我就可以部署了。es 已经申请好了。 |
稍等我半个小时,还在路上 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 单测修复一下
单侧好诡异,没看出来
有点迷,@tegg/tegg-plugin 更新啥了,把 getEggObject 类型更新没了 |
master 最新分支上的 tsc 都跪了.... |
@Beace 我来看看 |
ets 挂了 |
@Beace 合并 master 了,有类型定义错误 |
[skip ci] ## [3.43.0](v3.42.2...v3.43.0) (2023-09-01) ### Features * support npm search command like npmio ([#513](#513)) ([7f85848](7f85848))
r.cnpmjs.org 验证成功
|
author 识别有问题
|
npmmirror 也开启了 npm search antd --registry=https://registry.npmmirror.com
NAME | DESCRIPTION | AUTHOR | DATE | VERSION | KEYWORDS
@orca-fe/antd-plus | Transformer… | =nicokam… | 2023-09-01 | 0.3.3 | react antd antd-plus orca-fe orca orca-team
@ecoding/components.antd | > TODO: description | =w3cwhy | 2023-09-01 | 0.3.0 |
zat-design-pro-component | 基于 antd@4 版本开发 | =wanchongyang… | 2023-09-01 | 3.0.20-… |
@magicbe/design | React + Antd Drag… | =teacher-wang | 2023-09-01 | 0.0.49 | Component UI React
@qiankun-fix/element-ui | @qiankun-fix/antd… | =robinwm | 2023-09-01 | 0.7.8 | qiankun 微前端 element-UI vue
@magicbe/render | React + Antd render… | =teacher-wang | 2023-09-01 | 0.0.23 | Component UI React
@hbwow/custom-suspense | ## 1.x 版本基于… | =hbwow | 2023-09-01 | 0.0.3 | component frontend react react-component |
### 改动原因 在今年 4 月份,npm cli 对 search 做了[一些改动],在 4 月份以前(npm cli < `v10.6.0`),采用的是 `maintainers` 字段,而在 npm/cli#7407 后,改为使用: `publisher` 字段。 导致当 npm 版本大于等于 `v10.6.0` 后,search 结果中的 `author` 将变成 `???`,如图: ![CleanShot 2024-12-18 at 16 46 58@2x](https://github.com/user-attachments/assets/4b97bf63-78cb-4720-8c00-469eeff3e92f) 预期的结果应该为: ![CleanShot 2024-12-18 at 16 47 33@2x](https://github.com/user-attachments/assets/2d7fca89-4383-42bd-8b83-66257efe65e8) ### 技术细节说明 当前改动没有为 `es` 增加新的索引,原因是处于以下考虑: 1. es 的 `mapping` 一旦创建,就无法修改(虽然使用了 `dynamic: true` 但无法细粒度的进行控制) 2. 源数据中的 `_npmUser` 已经有相关信息了,没有必要为此浪费额外的磁盘空间 3. 如果想对以前的数据进行更新会比较麻烦,性价比较低 npm cli 老版本: https://github.com/npm/cli/pull/7407/files#diff-4bc15933c685fc9a9ce8be0c13a2f067f5e2b3334bacd6664bdfa7ddc46aedb6L58 npm cli 新版本: https://github.com/npm/cli/pull/7407/files#diff-4bc15933c685fc9a9ce8be0c13a2f067f5e2b3334bacd6664bdfa7ddc46aedb6R162 ### 其他 相关 PR: #513 PTAL @Beace @fengmk2 @elrrrrrrr [一些改动]: npm/cli#7407 Signed-off-by: Kevin Cui <bh@bugs.cc>
/-/v1/search?text=react&size=20&from=0&quality=0.65&popularity=0.98&maintenance=0.5
,第一版不一定能 qpm 都支持,先支持现有的下载量数据,即 popularity 的参考数据