Skip to content

Commit 05a1306

Browse files
authored
Enable registry usage by default (#1465)
1 parent 030522a commit 05a1306

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

scarb/src/core/lockfile.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ mod tests {
220220
[[package]]
221221
name = "first"
222222
version = "1.0.0"
223-
source = "registry+https://there-is-no-default-registry-yet.com/"
223+
source = "registry+https://scarbs.xyz/"
224224
checksum = "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
225225
dependencies = [
226226
"fourth",
@@ -229,7 +229,7 @@ mod tests {
229229
[[package]]
230230
name = "fourth"
231231
version = "80.0.85"
232-
source = "registry+https://there-is-no-default-registry-yet.com/"
232+
source = "registry+https://scarbs.xyz/"
233233
dependencies = [
234234
"third",
235235
]

scarb/src/core/registry/index/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub struct IndexConfig {
4444
}
4545

4646
impl IndexConfig {
47-
pub const WELL_KNOWN_PATH: &'static str = "config.json";
47+
pub const WELL_KNOWN_PATH: &'static str = "api/v1/index/config.json";
4848
}
4949

5050
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]

scarb/src/core/registry/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub mod patch_map;
1111
pub mod patcher;
1212
pub mod source_map;
1313

14-
pub const DEFAULT_REGISTRY_INDEX: &str = "https://there-is-no-default-registry-yet.com";
14+
pub const DEFAULT_REGISTRY_INDEX: &str = "https://scarbs.xyz/";
1515

1616
#[async_trait(?Send)]
1717
pub trait Registry {

scarb/src/core/source/id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ mod tests {
526526
// NOTE: Path sources are deliberately not tested here, because paths have different form
527527
// depending on running OS. We simply trust that this code works in that case.
528528
#[test_case(SourceId::mock_git() => "github.com-192sksn8g7p8c")]
529-
#[test_case(SourceId::default_registry() => "there-is-no-default-registry-yet.com-rlhm60tcalr0i")]
529+
#[test_case(SourceId::default_registry() => "scarbs.xyz-9djtpev4jug5q")]
530530
#[test_case(SourceId::for_std() => "std-drqrn62cbjj5g")]
531531
fn ident(source_id: SourceId) -> String {
532532
source_id.ident()

scarb/tests/http_registry.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn usage() {
4141
"#});
4242

4343
let expected = expect![["
44-
GET /config.json
44+
GET /api/v1/index/config.json
4545
accept: */*
4646
accept-encoding: gzip, br, deflate
4747
host: ...
@@ -118,7 +118,7 @@ fn publish_verified() {
118118
"#});
119119

120120
let expected = expect![["
121-
GET /config.json
121+
GET /api/v1/index/config.json
122122
accept: */*
123123
accept-encoding: gzip, br, deflate
124124
host: ...
@@ -198,7 +198,7 @@ fn not_found() {
198198
"#});
199199

200200
let expected = expect![["
201-
GET /config.json
201+
GET /api/v1/index/config.json
202202
accept: */*
203203
accept-encoding: gzip, br, deflate
204204
host: ...
@@ -229,7 +229,7 @@ fn not_found() {
229229
#[test]
230230
fn missing_config_json() {
231231
let registry = HttpRegistry::serve();
232-
fs::remove_file(registry.child("config.json")).unwrap();
232+
fs::remove_file(registry.child("api/v1/index/config.json")).unwrap();
233233

234234
let t = TempDir::new().unwrap();
235235
ProjectBuilder::start()
@@ -253,7 +253,7 @@ fn missing_config_json() {
253253
"#});
254254

255255
let expected = expect![["
256-
GET /config.json
256+
GET /api/v1/index/config.json
257257
accept: */*
258258
accept-encoding: gzip, br, deflate
259259
host: ...
@@ -310,7 +310,7 @@ fn caching() {
310310
.stdout_eq("");
311311

312312
let expected = expect![[r#"
313-
GET /config.json
313+
GET /api/v1/index/config.json
314314
accept: */*
315315
accept-encoding: gzip, br, deflate
316316
host: ...

utils/scarb-test-support/src/registry/http.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl HttpRegistry {
4545
});
4646
local
4747
.t
48-
.child("config.json")
48+
.child("api/v1/index/config.json")
4949
.write_str(&serde_json::to_string(&config).unwrap())
5050
.unwrap();
5151

0 commit comments

Comments
 (0)