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

v2.0 #136

Merged
merged 12 commits into from
Jul 29, 2023
Merged

v2.0 #136

merged 12 commits into from
Jul 29, 2023

Conversation

Byron
Copy link
Collaborator

@Byron Byron commented Jul 29, 2023

Tasks

  • changelog
  • refactor tests
  • rename testdata to fixtures
  • remove changes feature toggle
  • refactor source code structuring
  • cargo fmt!
  • run cargo-diet
  • change default features
  • bump version and set v2.0 in manifest
  • Update README to point to CHANGELOG.md, make sure to move all upgrade notes to it as well
  • add a way to open a git repo without fetching/updating no time, probably no need either

It only gated a little bit of code, but no dependencies. Thus it had no considerable
effect on build times and can be removed.
@Byron Byron force-pushed the v2.0 branch 2 times, most recently from a4e6df4 to 3ca0261 Compare July 29, 2023 13:15
@ToBinio
Copy link
Contributor

ToBinio commented Jul 29, 2023

thoughts about renaming Index to e.g GitIndex so its more clear that it only uses git and not both (git and sparse)

something that chooses the best index (#128) would be nice

@Byron
Copy link
Collaborator Author

Byron commented Jul 29, 2023

thoughts about renaming Index to e.g GitIndex so its more clear that it only uses git and not both (git and sparse)

This I am doing here.

something that chooses the best index (#128) would be nice

I don't plan to work on new features anytime soon, but contributions are welcome.

The goal is to keep related code together, instead of spreading it out into
top-level modules exclusively.

This also renames `Index` to `GitIndex`.
Further changes involved renaming `ChangesIter` to `git::Changes`, and
`INDEX_GIT_URL` to `git::URL`, and `CRATES_IO_HTTP_INDEX` to `sparse::URL`.
❯ cargo diet
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─────────────┐
│ Removed File                                                                                                         │ Size (Byte) │
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────────┤
│ .gitattributes                                                                                                       │          18 │
│ rustfmt.toml                                                                                                         │          47 │
│ .gitignore                                                                                                           │         234 │
│ examples/update_and_get_latest.rs                                                                                    │         576 │
│ .github/workflows/cargo.yml                                                                                          │         687 │
│ examples/sparse_http_ureq.rs                                                                                         │        1258 │
│ tests/mem.rs                                                                                                         │        1481 │
│ examples/sparse_http_reqwest.rs                                                                                      │        1543 │
│ tests/crates_index.rs                                                                                                │        1945 │
│ tests/fixtures/autocfg.txt                                                                                           │        2041 │
│ tests/fixtures/sparse_registry_cache/cargo_home/registry/index/index.crates.io-6f17d22bba15001f/.cache/au/to/autocfg │        2336 │
│ tests/sparse_index/mod.rs                                                                                            │        5136 │
│ tests/bare_index/mod.rs                                                                                              │        5701 │
│ tests/fixtures/crates-index.txt                                                                                      │       94107 │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────────┘
Saved 40% or 117.1 KB in 14 files (of 293.5 KB and 29 files in entire crate)

The following change was made to Cargo.toml:
Diff - removed / added + :
[…skipped 11 lines…]
edition = "2021"
rust-version = "1.60"
+include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]

[[example]]
[…skipped 52 lines…]
…ge defaults

* `git-index` -> `git`
* add `git-performance`
* `https` -> `git-https`
* `sparse-http` -> `sparse`

The default features are now `sparse`, effectively adjusting to the fact
that the default is now the http registry.
…uld be looked for.

This might be interesting also for tools that deal with the data alone, like `cargo-cache`.
@Byron Byron merged commit d3b0069 into master Jul 29, 2023
4 checks passed
@Byron Byron deleted the v2.0 branch July 29, 2023 19:07
@Byron
Copy link
Collaborator Author

Byron commented Jul 29, 2023

And here is the new release: https://github.com/frewsxcv/rust-crates-index/releases/tag/v2.0.0

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