ynpm-tool
yonyou FED large front end technology department, an enterprise internal contracting tool.
Last updated 7 days ago by liushld .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ynpm-tool 
SYNC missed versions from official npm registry.

概述

  ynpm是一款基于用友内部的镜像库,为用友内部打造一个优质的代码共享平台、业务组件的多样性、组件能力最大化的输出。把各种组件、工具的能力快速输出到各个项目中,提高项目的开发速度、节省项目成本、从而实现组件价值最大化、利益的最大化。

  ynpm还提供组件的上传、下载的以及热门组件的统计。进行有针对性的进行组件优化和能力的持续集成。

ynpm 功能特性

  1. 根据用户网络进行自动匹配、自动切换、内网快速下载
  2. 镜像无需同步,下载即缓存,实现一次下载,全员共享
  3. 安全可靠,友互通域账号权限校验
  4. 内网发包配置简单、融合github设置sshk模式
  5. 提供强大的cli工具、模块化的实现、快速融合其他cli工具
  6. 不对npm的镜像源入侵

基本原理

  1. 使用 Nexus Repository OSS 构建镜像
  2. 使用自己独立的数据存储、资源包做统计
  3. 使用koa+node做中间层做请求转发和校验机制
  4. react开发独立的官网站点

开始使用

安装

请确认你在本地全局安装了Node.js,然后使用npmynpm全局安装:

$ npm install ynpm-tool -g	

下载 package

# 安装到dependencies依赖的包 

$ ynpm install @yonyou/xxx --save

# 安装到devDependencies依赖的包 

$ ynpm install xxx --save-dev

也可以直接使用简写:

$ ynpm i @yonyou/xxx -S

显示ynpm的帮助信息;

$ ynpm -h

发包私有包到 ynpm

  1. 设置 ynpm

用户名必须是登录友互通的用户名

$ ynpm set user=xxx

邮箱必须是登录友互通的邮箱或者手机号

$ ynpm set email=xxx

显示sshk(不显示sshk见QA)

2. 复制sshk登陆官网-->选择头像-->选择设置sshk (如图)

新增sshk

3. 发布

$ cd xx_component && ynpm publish

显示finish xx_component 表示成功

官网搜索包名

发包规范

package.json 必填项

  1. name :模块名称,内部包统一用(@yonyou/xx)作为前缀

  2. homepage :组件主页url,eg: http://xx.git#redme

  3. author :作者

  4. repository :指定一个代码存放地址。string or {}

repository:'https://xxx.git' 
repository:{'url' : 'https://xxx.git'}

更多npm规范    例子

常用命令

命令 说明 使用
install / i 安装包 ynpm install
update 更新包 ynpm update
show 显示包信息 ynpm show <pkg>
list 显示当前安装报的版本 ynpm list
reinstall / rei 重装包 ynpm rei
sync 同步npm包到ynpm ynpm sync
publish 发布包到ynpm ynpm publish
set 设置ynpm的用户名 ynpm set user/email
version 查看ynpm版本 ynpm -v
help 查看帮助 ynpm -h
sshk 查看sshk ynpm sshk

Q&A常见问题

  1. 下载包极慢,报错timeout

    根据反馈,少数包会报错。原因是安装包依赖一个外链下载(可能是github或amazon等第三方地址)。因为众所周知的原因,你很有可能下载不到从而出现timeout(相同的问题cnpm也会存在).

  2. install 的时候出现 401 权限问题

请执行

 rm -rf ~/.ynpmrc
  1. 发包出现 400、401 的情况

    请重新 set 用户名、密码以及设置sshk

  2. windows电脑sshk不显示

    window电脑请使用git bash窗口模式,执行

    cat ~/.ynpmrc  # _auth后面的就是sshk
    

Current Tags

  • 3.2.19-alpha.1                                ...           alpha (7 days ago)
  • 2.0.23                                ...           beta (2 years ago)
  • 3.2.20                                ...           latest (7 days ago)
  • 3.2.10-outside                                ...           outside (2 months ago)

147 Versions

  • 3.2.20                                ...           7 days ago
  • 3.2.19-alpha.1                                ...           7 days ago
  • 3.2.19                                ...           7 days ago
  • 3.2.18                                ...           2 months ago
  • 3.2.18-alpha.3                                ...           2 months ago
  • 3.2.10-outside                                ...           2 months ago
  • 3.2.18-alpha.2                                ...           3 months ago
  • 3.2.18-alpha.1                                ...           3 months ago
  • 3.2.17                                ...           3 months ago
  • 3.2.17-alpha.8                                ...           3 months ago
  • 3.2.17-alpha.7                                ...           3 months ago
  • 3.2.17-alpha.6                                ...           3 months ago
  • 3.2.17-alpha.5                                ...           5 months ago
  • 3.2.17-alpha.4                                ...           5 months ago
  • 3.2.17-alpha.2                                ...           5 months ago
  • 3.2.17-alpah.1                                ...           5 months ago
  • 3.2.16                                ...           6 months ago
  • 3.2.16-alpha.1                                ...           6 months ago
  • 3.2.15                                ...           6 months ago
  • 3.2.15-alpha.3                                ...           6 months ago
  • 3.2.15-alpha.2                                ...           6 months ago
  • 3.2.15-alpha.1                                ...           6 months ago
  • 3.2.14                                ...           6 months ago
  • 3.2.14-alpha.7                                ...           6 months ago
  • 3.2.14-alpha.6                                ...           6 months ago
  • 3.2.14-alpha.5                                ...           6 months ago
  • 3.2.14-alpha.4                                ...           6 months ago
  • 3.2.14-alpha.3                                ...           6 months ago
  • 3.2.14-alpha.2                                ...           6 months ago
  • 3.2.14-alpha.1                                ...           6 months ago
  • 3.2.13-alpha.7                                ...           7 months ago
  • 3.2.13                                ...           7 months ago
  • 3.2.13-alpha.5                                ...           7 months ago
  • 3.2.13-alpha.4                                ...           7 months ago
  • 3.2.12                                ...           7 months ago
  • 3.2.12-alpha.1                                ...           7 months ago
  • 3.2.11                                ...           7 months ago
  • 3.2.11-alpha.8                                ...           7 months ago
  • 3.2.11-alpha.7                                ...           7 months ago
  • 3.2.11-alpha.6                                ...           7 months ago
  • 3.2.11-alpha.5                                ...           7 months ago
  • 3.2.11-alpha.4                                ...           8 months ago
  • 3.2.11-alpha.3                                ...           8 months ago
  • 3.2.11-alpha.2                                ...           8 months ago
  • 3.2.11-alpha.1                                ...           8 months ago
  • 3.2.10                                ...           9 months ago
  • 3.2.9                                ...           9 months ago
  • 3.2.9-alpha.1                                ...           9 months ago
  • 3.2.8                                ...           9 months ago
  • 3.2.8-alpha.14                                ...           10 months ago
  • 3.2.8-alpha.13                                ...           10 months ago
  • 3.2.8-alpha.12                                ...           10 months ago
  • 3.2.8-alpha.11                                ...           10 months ago
  • 3.2.8-alpha.10                                ...           10 months ago
  • 3.2.8-alpha.9                                ...           10 months ago
  • 3.2.8-alpha.8                                ...           10 months ago
  • 3.2.8-alpha.7                                ...           10 months ago
  • 3.2.8-alpha.6                                ...           10 months ago
  • 3.2.8-alpha.5                                ...           10 months ago
  • 3.2.8-alpha.3                                ...           10 months ago
  • 3.2.8-alpha.2                                ...           10 months ago
  • 3.2.8-alpha.1                                ...           10 months ago
  • 3.2.7-alpha.6                                ...           10 months ago
  • 3.2.7-alpha.5                                ...           a year ago
  • 3.2.7-alpha.4                                ...           a year ago
  • 3.2.7-alpha.2                                ...           a year ago
  • 3.2.7-alpha.1                                ...           a year ago
  • 3.2.7                                ...           a year ago
  • 3.2.6-alpha.7                                ...           a year ago
  • 3.2.6-alpha.6                                ...           a year ago
  • 3.2.6-alpha.5                                ...           a year ago
  • 3.2.6-alpha.4                                ...           a year ago
  • 3.2.6-alpha.3                                ...           a year ago
  • 3.2.6-alpha.2                                ...           a year ago
  • 3.2.6-alpha.1                                ...           a year ago
  • 3.2.6                                ...           a year ago
  • 3.2.5-alpha.2                                ...           a year ago
  • 3.2.5-alpha.1                                ...           a year ago
  • 3.2.5                                ...           a year ago
  • 3.2.4                                ...           a year ago
  • 3.2.3-alpha.3                                ...           a year ago
  • 3.2.3-alpha.2                                ...           a year ago
  • 3.2.3-alpha.1                                ...           a year ago
  • 3.2.3                                ...           a year ago
  • 3.2.2-alpha.2                                ...           a year ago
  • 3.2.2-alpha.1                                ...           a year ago
  • 3.2.2                                ...           a year ago
  • 3.2.1-alpha.5                                ...           a year ago
  • 3.2.1-alpha.4                                ...           a year ago
  • 3.2.1-alpha.3                                ...           a year ago
  • 3.2.1-alpha.2                                ...           a year ago
  • 3.2.1-alpha.1                                ...           a year ago
  • 3.2.1                                ...           a year ago
  • 3.2.0-alpha.1                                ...           a year ago
  • 3.2.0                                ...           a year ago
  • 3.1.3-alpha.11                                ...           a year ago
  • 3.1.3-alpha.10                                ...           a year ago
  • 3.1.3-alpha.9                                ...           a year ago
  • 3.1.3-alpha.6                                ...           a year ago
  • 3.1.3-alpha.5                                ...           a year ago
  • 3.1.3-alpha.4                                ...           a year ago
  • 3.1.3-alpha.3                                ...           a year ago
  • 3.1.3-alpha.2                                ...           a year ago
  • 3.1.3-alpha.1                                ...           a year ago
  • 3.0.1-alpha.1                                ...           a year ago
  • 3.1.3                                ...           a year ago
  • 3.1.2                                ...           a year ago
  • 3.1.1-alpha.1                                ...           a year ago
  • 3.1.1                                ...           a year ago
  • 3.1.0                                ...           a year ago
  • 3.0.3-alpha.2                                ...           a year ago
  • 3.0.3-alpha.1                                ...           a year ago
  • 3.0.2                                ...           a year ago
  • 3.0.1-alpha.0                                ...           a year ago
  • 3.0.1                                ...           a year ago
  • 2.0.0-alpha.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.0.23                                ...           2 years ago
  • 2.0.22                                ...           2 years ago
  • 2.0.21                                ...           2 years ago
  • 2.0.20                                ...           2 years ago
  • 2.0.19                                ...           2 years ago
  • 2.0.18                                ...           2 years ago
  • 2.0.16                                ...           2 years ago
  • 2.0.15                                ...           2 years ago
  • 2.0.14                                ...           2 years ago
  • 2.0.13                                ...           2 years ago
  • 2.0.12                                ...           2 years ago
  • 2.0.11                                ...           2 years ago
  • 2.0.10                                ...           2 years ago
  • 2.0.9                                ...           2 years ago
  • 2.0.8                                ...           2 years ago
  • 2.0.7                                ...           2 years ago
  • 2.0.6                                ...           2 years ago
  • 2.0.5                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.8                                ...           3 years ago
  • 0.0.7                                ...           3 years ago
Downloads
Today 6
This Week 6
This Month 359
Last Day 4
Last Week 161
Last Month 418
Dependencies (16)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |