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

feat: support semver #816

Merged
merged 4 commits into from Feb 1, 2016
Merged

feat: support semver #816

merged 4 commits into from Feb 1, 2016

Conversation

@dead-horse
Copy link
Member

@dead-horse dead-horse commented Jan 30, 2016

e.x. /npm/~1.0.0

closes #814

e.x. `/npm/~1.0.0`
@@ -73,6 +74,18 @@ exports.getModuleByTag = function* (name, tag) {
return yield* exports.getModule(tag.name, tag.version);
};

exports.getModuleByRange = function* (name, range) {
var rows = yield* exports.listModulesByName(name);

This comment has been minimized.

@fengmk2

fengmk2 Jan 30, 2016
Member

yield

This comment has been minimized.

@dead-horse

dead-horse Jan 30, 2016
Author Member

到处都是 yield* ,先保留,后续找时间重构的时候全部替换掉吧

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Jan 30, 2016

pnpm need this feat
image

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Jan 30, 2016

@dead-horse ci fail

@@ -65,9 +65,9 @@ function routes(app) {

// module
// scope package: params: [$name]
app.get(/^\/(@[\w\-\.]+\/[\w\-\.]+)$/, syncByInstall, listAllVersions);
app.get(/^\/(@[\w\-\.]+\/[^\/]+)$/, syncByInstall, listAllVersions);

This comment has been minimized.

@fengmk2

fengmk2 Jan 30, 2016
Member

这个不需要修改吧。

// scope package: params: [$name, $version]
app.get(/^\/(@[\w\-\.]+\/[\w\-\.]+)\/([\w\.\-]+)$/, syncByInstall, getOneVersion);
app.get(/^\/(@[\w\-\.]+\/[\w\-\.]+)\/([^\/]+)$/, syncByInstall, getOneVersion);

This comment has been minimized.

@fengmk2

fengmk2 Jan 30, 2016
Member

这个正则范围会不会太广了。[\^\~\>\=\<\|]*[\w\.\-]+ 即可

This comment has been minimized.

@fengmk2

fengmk2 Jan 30, 2016
Member

呃,不对,semver 会很复杂。。。还是你改的这样吧。如 >=1.2.7 <1.3.0

@@ -45,6 +54,19 @@ describe('controllers/registry/package/show.test.js', function () {
});
});

it('should return max satisfied package with semver range', function (done) {
request(app.listen())
.get('/@cnpmtest/testmodule-show/^1.0.0')

This comment has been minimized.

@fengmk2

fengmk2 Jan 30, 2016
Member

加一些复杂的情况 >=1.2.7 <1.3.0

This comment has been minimized.

@fengmk2

fengmk2 Jan 30, 2016
Member

1.2.7 || >=1.2.9 <2.0.0

This comment has been minimized.

@dead-horse

dead-horse Jan 30, 2016
Author Member

测试补了

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Jan 30, 2016

@dead-horse
Copy link
Member Author

@dead-horse dead-horse commented Jan 30, 2016

又有人上传了 tfs 导致 ci 挂了,我换了一个包,等它生效。。。

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Jan 31, 2016

mysql 挂了?

@dead-horse dead-horse force-pushed the feat-semver branch from 77a7d16 to 44976f4 Jan 31, 2016
@codecov-io
Copy link

@codecov-io codecov-io commented Jan 31, 2016

Current coverage is 82.43%

Merging #816 into master will decrease coverage by -0.21% as of 2f29e23

@@            master    #816   diff @@
======================================
  Files           84      84       
  Stmts         3227    3239    +12
  Branches       598     599     +1
  Methods          0       0       
======================================
+ Hit           2667    2670     +3
- Partial        202     211     +9
  Missed         358     358       

Review entire Coverage Diff as of 2f29e23

Powered by Codecov. Updated on successful CI builds.

@dead-horse
Copy link
Member Author

@dead-horse dead-horse commented Jan 31, 2016

过了

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Feb 1, 2016

+1

fengmk2 added a commit that referenced this pull request Feb 1, 2016
@fengmk2 fengmk2 merged commit 3a46b97 into master Feb 1, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@fengmk2 fengmk2 deleted the feat-semver branch Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants