
Product
Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.
sherlock-cli
Advanced tools
链尚网React-Native 组件库 CLI
查看:组件库文档
本地安装
npm install sherlock-cli --save
全局安装
npm install sherlock-cli -g
sherlock组件库的结构:
Libraries/:
存放所有组件(包括新建的组件)
每个组件为单独的一个Nodejs 模块包(需要单独进行Npm 发布)
sherlock-mind:
用于引用Libraries下所有组件的nodejs模块,相当于组件库模块,
我们在使用时 只要依赖shelock-mind就可以了
例如:
package.json:
dependencies:{
'sherlock-mind':'^0.1.x'
}
import {Modal} from 'sherlock-mind'
在使用sherlock相关命令变更组件时,会自动刷新
sherlock-mind对Libraries的引用,以及版本号变更
例如:
使用npm run new modal
会自动刷新sherlock-min/index.js 新增对modal的引用
....
import Modal from "sherlock-modal"
export {Modal,....}
以及更新sherlock-mind的package.json
dependencies:{
'sherlock-modal':'xx.x.x'
}
命令:
npm run new <模块名称> [平台类型(默认:common 可选:ios,android,web,all(所有支持的平台))] [force(是否强制覆盖已存在的组件)]
执行新建组件命令后,可以在Libraries目录找到组件模块目录,支持快速调试指定工程。
例如:
sherlock new Modal
Libraries目录下:
Modal
Modal/package.json
Modal/test/index.js
Modal/src/index.js
Modal/src/Modal.js
多平台:
Modal/src/Modal.web.js
Modal/src/Modal.android.js
Modal/src/Modal.ios.js
package.json
{
name:'sherlock-modal' //默认会在组件名称前面添加sherlock前缀
}
更新sherlock-mind
更新sherlock-mind/index.js 引用
更新sherlock-mind/package.json /dependencies
命令:
npm run remove <组件名称>
删除Libraries/组件
移除sherlock-mind对组件引用
命令:
npm run release <组件名称> [组件版本号(可选)]
npm run release modal (根据sherlock-modal/package.json的version发布)
npm run release modal 1.0.3 (强制使用1.0.3发布版本(不能小于当前组件版本号)
发布过程:
1.npm publish 发布当前组件
2.更新sherlock-mind 对组件的引用(package.json dependencies以及引用)
3.npm publish sherlock-mind (sherlock-mind版本自动patch +1,如果当前组件为新增组件 则minor+1)
快速全局调试:
1.修改根目录下要测试的组件模块 sherlock.js
2.执行 npm test [可选平台ios android web,默认:web]
例如:
npm test
npm test android
npm test ios
npm test web
其他调试:
命令:
npm run debug [platform(平台类型 ios android web)] [组件名称(可选)]
调试准备:
1.修改组件目录下的/test/index.js
单组件调试:
npm run debug [android/ios/web] 组件名称
例如: npm run debug web modal
全局调试:
npm run debug [android/ios/web]
例如: npm run debug web
调试sherlock-mind
npm run debug android/web/ios ./sherlock-mind/test/index.js
安装:
npm install sherlock-mind
使用:
```js
import {Modal,Base} from 'sherlock-mind'
class Page extends React.Component{
render(){
<Modal .... />
}
}
```
安装cli:
npm install sherlock-cli -g
为什么有CLI
可以在快在其他工程下,建立sherlock风格的组件库
使用:
创建组件
sherlock new <模块名称> [平台类型(默认:common 可选:ios,android,web,all(所有支持的平台))] [force(是否强制覆盖已存在的组件)]
例如:sherlock new Modal all
注意:新创建的组件均继承于sherlock-base组件 sherlock-base进行组件性能优化 详情参见sherlock-base组件
调试组件
sherlock debug <plaform> <entry> --platform:默认:web
sherlock debug (android 或 ios 或 web) (其中可以使用,号连接,表示同时启动多个平台的调试)
删除组件
sherlock remove <组件名称>
发布组件
sherlock release <组件名称> [组件版本号(可选)]
基于 MIT License 开源,使用代码只需说明来源,或者引用 license.txt 即可。
FAQs
component library for react-native and react-native-web
The npm package sherlock-cli receives a total of 20 weekly downloads. As such, sherlock-cli popularity was classified as not popular.
We found that sherlock-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.