Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

source 换成 registry 的方案整理 #888

Closed
sorrycc opened this issue Jul 15, 2014 · 1 comment
Closed

source 换成 registry 的方案整理 #888

sorrycc opened this issue Jul 15, 2014 · 1 comment
Assignees
Milestone

Comments

@sorrycc
Copy link
Member

sorrycc commented Jul 15, 2014

缘起

目前切换源时需要先配置再使用,比较麻烦。比如要换个源进行安装,需要:

spm config source:myregistry http://my.registry/
spm install --source myregistry

考虑换成 npm 的方式:

spm install --registry http://my.registry/
spm install -r http://my.registry/

方案

配置文件格式调整

现有配置:

[source:default]
url = http://spmjs.io/
auth = 12345

[source:localhost]
url = http://localhost/
auth = 12345

新配置:

registry = http://spmjs.io/
auth = 12345

注意:这里的 auth 属性直接放根目录后,如果两个源都需要认证,切换之后需要重新登录。但这种情况会比较少,私有源通常可以匿名发布。

相关命令和文件

  1. login
  2. publish
  3. unpublish
  4. install
  5. info
  6. search
  7. config
  8. lib/sdk/yuan.js

更新脚本

添加 post install 脚本,把之前的配置转换成新配置。

@afc163
Copy link
Member

afc163 commented Jul 15, 2014

赞。

补充 spm doc publish 。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants