Skip to content

Commit 19bd9fd

Browse files
committed
Merge remote-tracking branch 'upstream/master' into sunjay-master
2 parents b73a797 + 487166c commit 19bd9fd

File tree

117 files changed

+2491
-1784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+2491
-1784
lines changed

.rustfmt.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
fn_args_layout = "Block"
2-
array_layout = "Block"
3-
control_style = "Rfc"
4-
where_style = "Rfc"
5-
generics_indent = "Block"
6-
fn_call_style = "Block"
71
combine_control_expr = true
8-
fn_args_paren_newline = false
92
max_width = 100
103
error_on_line_overflow = false
114
write_mode = "Overwrite"

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ before_install:
2121
- nvm install 8
2222

2323
install:
24-
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
25-
- npm install
26-
- cargo install --force diesel_cli --vers 0.16.0 --debug --no-default-features --features postgres && export PATH=$HOME/.cargo/bin:$PATH
24+
- cargo install --force diesel_cli --vers 1.0.0 --no-default-features --features postgres && export PATH=$HOME/.cargo/bin:$PATH
2725

2826
before_script:
2927
- diesel database setup
@@ -44,16 +42,17 @@ matrix:
4442
allow_failures:
4543
- rust: nightly
4644
include:
47-
- rust: nightly-2017-11-07
45+
- rust: nightly-2018-02-13
4846
script:
49-
- cargo install --force rustfmt-nightly --vers 0.2.15
50-
- cargo install --force clippy --vers 0.0.169
47+
- cargo install --force rustfmt-nightly --vers 0.3.6
5148
- cargo fmt -- --write-mode=diff
49+
- cargo install --force clippy --vers 0.0.186
5250
- cargo clippy
5351
- rust: stable
5452
script:
5553
- cargo build
5654
- cargo test
55+
- npm install
5756
- npm test
5857
- rust: beta
5958
script:
@@ -68,6 +67,7 @@ env:
6867
global:
6968
- DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
7069
- TEST_DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
70+
- CARGO_TARGET_DIR=target
7171

7272
notifications:
7373
email:

Cargo.lock

Lines changed: 683 additions & 490 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "cargo-registry"
33
authors = ["Alex Crichton <[email protected]>"]
44
version = "0.2.2"
5-
license = "MIT/Apache-2.0"
5+
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/rust-lang/crates.io"
77
description = "Backend of crates.io"
88

@@ -28,37 +28,38 @@ rustdoc-args = [
2828

2929
[dependencies]
3030
cargo-registry-s3 = { path = "src/s3", version = "0.2.0" }
31-
rand = "0.3"
31+
rand = "0.4"
3232
git2 = "0.6.4"
33-
flate2 = "0.2"
33+
flate2 = "1.0"
3434
semver = "0.5"
35-
url = "1.2.1"
35+
url = "1.2"
3636
tar = "0.4.13"
3737

38-
r2d2 = "0.8.0"
39-
openssl = "0.9.14"
38+
openssl = "0.10.0"
4039
curl = "0.4"
4140
oauth2 = "0.3"
4241
log = "0.3"
43-
env_logger = "0.4"
44-
hex = "0.2"
42+
env_logger = "0.5"
43+
hex = "0.3"
4544
htmlescape = "0.3.1"
4645
license-exprs = "^1.3"
47-
dotenv = "0.10.0"
46+
dotenv = "0.11.0"
4847
toml = "0.4"
49-
diesel = { version = "0.99.0", features = ["postgres", "serde_json", "chrono"] }
50-
r2d2-diesel = "0.99.0"
51-
diesel_full_text_search = "0.99.0"
48+
diesel = { version = "1.1.0", features = ["postgres", "serde_json", "chrono", "r2d2"] }
49+
diesel_full_text_search = "1.0.0"
5250
serde_json = "1.0.0"
5351
serde_derive = "1.0.0"
5452
serde = "1.0.0"
5553
chrono = { version = "0.4.0", features = ["serde"] }
5654
comrak = { version = "0.2.3", default-features = false }
5755
ammonia = "1.0.0"
5856
docopt = "0.8.1"
59-
itertools = "0.6.0"
60-
lettre = "0.6"
57+
itertools = "0.7.0"
6158
scheduled-thread-pool = "0.2.0"
59+
derive_deref = "1.0.0"
60+
61+
lettre = "0.7"
62+
lettre_email = "0.7"
6263

6364
conduit = "0.8"
6465
conduit-conditional-get = "0.8"
@@ -81,6 +82,10 @@ tokio-core = "0.1"
8182
tokio-service = "0.1"
8283

8384
[build-dependencies]
84-
dotenv = "0.10"
85-
diesel = { version = "0.99.0", features = ["postgres"] }
86-
diesel_migrations = { version = "0.99.0", features = ["postgres"] }
85+
dotenv = "0.11"
86+
diesel = { version = "1.1.0", features = ["postgres"] }
87+
diesel_migrations = { version = "1.1.0", features = ["postgres"] }
88+
89+
# Remove once cookie depends on ring >= 0.13.0
90+
[patch.crates-io]
91+
ring = { git = "https://github.com/SergioBenitez/ring", branch = "v0.11" }

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,12 @@ categories will be synced from this file.
5757
## Running a mirror
5858

5959
Please see [docs/MIRROR.md](https://github.com/rust-lang/crates.io/blob/master/docs/MIRROR.md) for instructions on setting up a mirror of crates.io.
60+
61+
## License
62+
63+
Licensed under either of these:
64+
65+
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
66+
https://www.apache.org/licenses/LICENSE-2.0)
67+
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
68+
https://opensource.org/licenses/MIT)

app/components/badge-appveyor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default Component.extend({
2828

2929
projectName: computed('badge.attributes.project_name', function() {
3030
return this.get('badge.attributes.project_name') ||
31-
this.get('badge.attributes.repository').replace(/_/g, '-');
31+
this.get('badge.attributes.repository').replace(/[_.]/g, '-');
3232
}),
3333

3434
service: computed('badge.attributes.service', function() {

app/components/user-avatar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { computed } from '@ember/object';
55
export default Component.extend({
66
size: 'small',
77
user: null,
8-
attributeBindings: ['src', 'width', 'height'],
8+
attributeBindings: ['src', 'width', 'height', 'alt'],
99
tagName: 'img',
1010

1111
width: computed('size', function() {
@@ -20,6 +20,10 @@ export default Component.extend({
2020

2121
height: readOnly('width'),
2222

23+
alt: computed('user', function() {
24+
return `${this.get('user.name')} (${this.get('user.login')})`;
25+
}),
26+
2327
src: computed('size', 'user', function() {
2428
return `${this.get('user.avatar')}&s=${this.get('width') * 2}`;
2529
})

app/controllers/application.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ export default Controller.extend(EKMixin, {
2121
}),
2222

2323
actions: {
24-
search(q) {
25-
if (q !== undefined) {
26-
this.set('searchQuery', q);
27-
}
28-
24+
search() {
2925
this.transitionToRoute('search', {
3026
queryParams: {
3127
q: this.get('searchQuery'),

app/controllers/me/crates.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ export default Controller.extend(PaginationMixin, {
1515
totalItems: readOnly('model.meta.total'),
1616

1717
currentSortBy: computed('sort', function() {
18-
return (this.get('sort') === 'downloads') ? 'Downloads' : 'Alphabetical';
18+
if (this.get('sort') === 'downloads') {
19+
return 'All-Time Downloads';
20+
} else if (this.get('sort') === 'recent-downloads') {
21+
return 'Recent Downloads';
22+
} else {
23+
return 'Alphabetical';
24+
}
1925
}),
2026
});

app/controllers/search.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import { computed } from '@ember/object';
33
import { alias, bool, readOnly } from '@ember/object/computed';
44
import { inject as service } from '@ember/service';
55

6-
import { task, timeout } from 'ember-concurrency';
6+
import { task } from 'ember-concurrency';
77

88
import PaginationMixin from '../mixins/pagination';
99

10-
const DEBOUNCE_MS = 250;
11-
1210
export default Controller.extend(PaginationMixin, {
1311
search: service(),
1412
queryParams: ['q', 'page', 'per_page', 'sort'],
@@ -42,13 +40,10 @@ export default Controller.extend(PaginationMixin, {
4240
hasItems: bool('totalItems'),
4341

4442
dataTask: task(function* (params) {
45-
// debounce the search query
46-
yield timeout(DEBOUNCE_MS);
47-
4843
if (params.q !== null) {
4944
params.q = params.q.trim();
5045
}
5146

5247
return yield this.store.query('crate', params);
53-
}).restartable(),
48+
}).drop(),
5449
});

app/styles/app.scss

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ body {
8484

8585
button {
8686
background: none;
87-
outline: 0;
8887
border: 0;
8988
padding: 10px 0;
9089

@@ -130,7 +129,6 @@ body {
130129
font-size: 90%;
131130
border: none;
132131
color: black;
133-
outline: 0;
134132
margin-left: 30px;
135133
padding: 5px 5px 5px 25px;
136134
background-color: white;
@@ -141,6 +139,15 @@ body {
141139
@include border-radius(15px);
142140
}
143141

142+
form.search label {
143+
position: absolute;
144+
left: -10000px;
145+
top: auto;
146+
width: 1px;
147+
height: 1px;
148+
overflow: hidden;
149+
}
150+
144151
#header input.search {
145152
width: 100%;
146153
margin-left: 16px;

app/styles/crate.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@
190190
font-size: 90%;
191191
margin-bottom: 20px;
192192

193+
ol {
194+
list-style: none;
195+
padding: 0;
196+
}
197+
ol, li { display: inline; }
198+
193199
a {
194200
color: $main-color-light;
195201
text-decoration: none;
@@ -206,7 +212,7 @@
206212
border-bottom: 5px solid $gray-border;
207213
margin-bottom: 20px;
208214

209-
@media only screen and (min-width: 820px) {
215+
@media only screen and (min-width: 890px) {
210216
@include flex-direction(row);
211217

212218
.docs {
@@ -363,6 +369,10 @@
363369
font-size: 160%;
364370
font-weight: bold;
365371
margin-bottom: 4px;
372+
&__align {
373+
position: relative;
374+
bottom: 0.4rem;
375+
}
366376
}
367377
}
368378

app/styles/home.scss

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
margin-right: 10px;
2121
}
2222

23-
&:hover { @include vertical-gradient($start_dark, $end_dark); outline: 0; }
23+
&:hover, &:focus { @include vertical-gradient($start_dark, $end_dark); outline: 0; }
2424
&.active { @include vertical-gradient($start_dark, $end_dark); outline: 0; }
2525
&[disabled] {
2626
@include vertical-gradient($start_light, $end_light);
@@ -96,7 +96,10 @@ button.small {
9696

9797
@media only screen and (max-width: 530px) {
9898
@include flex-direction(column);
99-
#stats { border: none; }
99+
#stats {
100+
border: none;
101+
margin: auto;
102+
}
100103
.crates, .downloads {
101104
@include justify-content(center);
102105
}
@@ -111,9 +114,17 @@ button.small {
111114
line-height: 20px;
112115
}
113116

114-
> div { margin: 0 15px; }
117+
> section { margin: 0 15px; }
118+
119+
> section[aria-busy="true"] > h2::after {
120+
content: '';
121+
background-image: url('/assets/ajax-loader.gif');
122+
display: inline-block;
123+
height: 16px;
124+
width: 16px;
125+
}
115126

116-
ul { list-style: none; padding: 0; }
127+
ul, ol { list-style: none; padding: 0; }
117128
li { margin: 8px 0; }
118129

119130
li a {
@@ -143,7 +154,7 @@ button.small {
143154
@include flex-wrap(wrap);
144155
@include justify-content(left);
145156

146-
> div {
157+
> section {
147158
margin: 0;
148159
padding: 0 15px;
149160
width: 33.33%;

app/styles/me.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
margin-bottom: 20px;
178178
background-color: $bg;
179179
color: white;
180-
&:hover { background-color: darken($bg, 10%); }
180+
&:hover, &:focus { background-color: darken($bg, 10%); }
181181
}
182182
}
183183

0 commit comments

Comments
 (0)