Skip to content
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

semver 和 publish 的调整 #81

Merged
merged 12 commits into from
Dec 18, 2014
Merged

semver 和 publish 的调整 #81

merged 12 commits into from
Dec 18, 2014

Conversation

sorrycc
Copy link
Member

@sorrycc sorrycc commented Nov 17, 2014

  • 增加 package 对于 semver 支持

    比如:
    repository/sorrycc/~1.2.1 > sorrycc@1.2.2
    package/sorrycc/~1.2.1 > sorrycc@1.2.2
    
  • 删除 publish -f 支持

  • 调整 unpublish。不直接删除 package 或 project,只做信息清空,避免变相达到 publish -f 的操作

    1. unpublish Package 时,添加 unpublished 信息,删除 tar 包
    2. unpublish Project 时,添加 unpublished 信息,同时对所有的 Package 做 unpublish 处理
    3. publish Package 时,Project 删除 unpublished 信息,Package 不允许覆盖
    4. 其他对于 Project 和 Package 的处理,过滤掉包含 unpublished 信息的
  • 增加 Project unpublish 后的页面展现


相关 issue: spmjs/spm/issues/1001spmjs/spm/issues/1000

@sorrycc
Copy link
Member Author

sorrycc commented Nov 18, 2014

完成了。 @afc163 看下有没有问题。

@@ -361,7 +365,7 @@ function abortify(res, options) {
406: 'Not acceptable.',
415: 'Unsupported media type.',
426: 'Upgrade required.',
444: 'Force option required.'
444: 'Cannot modify pre-existing version.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-existing -> existed ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

从 npm 上 copy 来的。。两个意思差不多。

@afc163
Copy link
Member

afc163 commented Nov 18, 2014

  1. 对于 unpublished 模块的页面展示没做。
  2. spm build 构建也需要同步支持。

var project = new Project({
name: req.params.name
});
var version = semver.maxSatisfying(Object.keys(project.packages), req.params.version);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个方法其实已经同时支持了 ~ ^ * 1.x >1.0.0 等各种情况吧?会不会太激进了。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

版本的问题我觉得可以让使用者自己判断,信任一个库才使用他,如果一个库使用了 * 这样的版本范围,则可以选择不用他。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

内部组件(arale, alipay, anima)可以约定下只能用 patch range ~1.1.x。另外,内部工具在构建时候可以判断下范围是否过大,然后给予提示。

@sorrycc
Copy link
Member Author

sorrycc commented Nov 18, 2014

  1. unpublished 模块页面的展现我加下
  2. spm-build 在 3.3 和 spm-client 的 pr 里已处理

@sorrycc
Copy link
Member Author

sorrycc commented Nov 18, 2014

unpublished 的模块展现已加,类似 npm .

@afc163
Copy link
Member

afc163 commented Nov 18, 2014

安装模块、查询模块、查询模块版本列表时,对于 unpublished 的模块也需要处理吧?

@sorrycc
Copy link
Member Author

sorrycc commented Nov 18, 2014

install, info 等和源相关的操作测试过了,原来的逻辑都兼容的。

sorrycc added a commit that referenced this pull request Dec 18, 2014
semver 和 publish 的调整
@sorrycc sorrycc merged commit 22b9862 into master Dec 18, 2014
@sorrycc sorrycc deleted the semver branch December 18, 2014 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants