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: initial lockfile implementation #128

Merged
merged 199 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
0ae070d
fix: name of `lockfileVersion`
KSXGitHub Sep 22, 2023
558ed25
feat: validate comver
KSXGitHub Sep 22, 2023
ecec721
feat: remove unused functions
KSXGitHub Sep 22, 2023
93f4ae5
feat: custom type for dependency paths
KSXGitHub Sep 22, 2023
a4f30b4
feat: zero-copy deserialization for ComVer
KSXGitHub Sep 22, 2023
e80162d
feat: owned types are simpler
KSXGitHub Sep 22, 2023
45c1c5f
feat: method to load lockfile from current dir
KSXGitHub Sep 22, 2023
3d24ab3
refactor: stop qualified
KSXGitHub Sep 22, 2023
7229ad6
feat: add `lockfile` to `PackageManager` (wip)
KSXGitHub Sep 22, 2023
1309e8e
refactor: rename a function
KSXGitHub Sep 22, 2023
cdc1362
feat: add group to `PackageJson::dependencies`
KSXGitHub Sep 22, 2023
066d287
feat: mark lockfile as todo
KSXGitHub Sep 22, 2023
7a4e399
feat: --lockfile
KSXGitHub Sep 23, 2023
955bf1b
refactor: correct a name
KSXGitHub Sep 23, 2023
94697b5
feat: only load lockfile when required
KSXGitHub Sep 23, 2023
5bb6f39
refactor: rearrange
KSXGitHub Sep 23, 2023
81bc604
refactor: create load_lockfile
KSXGitHub Sep 23, 2023
63db640
style: add an empty line
KSXGitHub Sep 23, 2023
5a133c4
docs: reference specs
KSXGitHub Sep 23, 2023
012faa9
refactor: move LockfileDependency to its own mod
KSXGitHub Sep 23, 2023
9411705
docs: reference the typescript interface
KSXGitHub Sep 23, 2023
f8c11cc
refactor: create resolution.rs
KSXGitHub Sep 23, 2023
e0fe68c
refactor: rename
KSXGitHub Sep 23, 2023
0b6e6d1
feat: expose `integrity`
KSXGitHub Sep 23, 2023
71326a1
feat: more resolution types
KSXGitHub Sep 23, 2023
6b2af2b
refactor: rename
KSXGitHub Sep 23, 2023
0e768f2
refactor: move
KSXGitHub Sep 23, 2023
b7a5f48
refactor: rename
KSXGitHub Sep 23, 2023
6081fb1
docs: remove private documentation
KSXGitHub Sep 23, 2023
ea28171
refactor: remove private constant
KSXGitHub Sep 23, 2023
1ffc837
feat: remove private `tag` field
KSXGitHub Sep 23, 2023
99e7c5f
style: group things closer
KSXGitHub Sep 23, 2023
9a2e6ff
refactor: remove unnecessary derives
KSXGitHub Sep 23, 2023
d3399d4
fix: TarballResolution
KSXGitHub Sep 23, 2023
d97403f
feat: skip on None
KSXGitHub Sep 23, 2023
e02ab66
test: TarballResolution
KSXGitHub Sep 23, 2023
56a8e69
feat: remove IntegrityResolution
KSXGitHub Sep 24, 2023
4927863
refactor: rewrite
KSXGitHub Sep 24, 2023
9e1d509
fix: incorrect assumption
KSXGitHub Sep 24, 2023
0239ff1
feat: RegistryResolution
KSXGitHub Sep 24, 2023
a4e1e5a
test: without integrity
KSXGitHub Sep 24, 2023
e9f5527
test: DirectoryResolution
KSXGitHub Sep 24, 2023
78c3d82
refactor: use text_block_macros
KSXGitHub Sep 24, 2023
0ac4537
test: GitResolution
KSXGitHub Sep 24, 2023
a024208
refactor: consistency
KSXGitHub Sep 24, 2023
45985e8
feat: prioritize most used resolution type
KSXGitHub Sep 24, 2023
d96c94b
test: RegistryResolution
KSXGitHub Sep 24, 2023
a59b0b0
feat: deny unknown fields
KSXGitHub Sep 24, 2023
024cd98
feat: LockfileResolution::integrity
KSXGitHub Sep 24, 2023
546ffac
feat: rename the lockfile
KSXGitHub Sep 24, 2023
87d7e00
docs: add some doccomments
KSXGitHub Sep 24, 2023
48c35bc
feat: skip serializing for None
KSXGitHub Sep 24, 2023
b2f3685
docs: fix links
KSXGitHub Sep 24, 2023
d9fcbba
refactor: consistency
KSXGitHub Sep 24, 2023
b74ed61
refactor: reduce future diffs
KSXGitHub Sep 24, 2023
dc8aa89
feat: project snapshot types
KSXGitHub Sep 24, 2023
510b473
fix: try multi first to avoid false empty single
KSXGitHub Sep 24, 2023
72e5fb4
feat: deny_unknown_fields for extra safety
KSXGitHub Sep 24, 2023
0a5e86f
feat: derive Default for convenience
KSXGitHub Sep 24, 2023
4e2a1a2
feat: deny_unknown_fields for MultiProjectSnapshot
KSXGitHub Sep 24, 2023
1ab37dd
test: make sure it parse correctly
KSXGitHub Sep 24, 2023
341b2dd
refactor: consistency
KSXGitHub Sep 24, 2023
964602a
docs: clarify
KSXGitHub Sep 25, 2023
b661108
feat: check for compatibility at serde
KSXGitHub Sep 25, 2023
cd2756c
feat: add some more code (wip)
KSXGitHub Sep 25, 2023
b65a963
docs: syntax of dependency path
KSXGitHub Sep 25, 2023
89a787a
docs: add some todos
KSXGitHub Sep 25, 2023
bf3716b
refactor: consistency
KSXGitHub Sep 25, 2023
7e65399
feat: PkgNameVer
KSXGitHub Sep 25, 2023
ae33dd8
docs: add examples
KSXGitHub Sep 25, 2023
0e38e3b
feat: PkgNameVer::new
KSXGitHub Sep 25, 2023
60aebc6
fix: scoped package names
KSXGitHub Sep 25, 2023
6734abe
fix: checking empty name
KSXGitHub Sep 25, 2023
47c692a
feat: ParsePkgNameVerError::MissingVersion
KSXGitHub Sep 25, 2023
e27b01c
test: PkgNameVer
KSXGitHub Sep 25, 2023
8b2b85d
docs: explain quirks
KSXGitHub Sep 25, 2023
1877107
refactor: reuse
KSXGitHub Sep 25, 2023
1d03999
refactor: move to another mod
KSXGitHub Sep 25, 2023
58b3a24
feat: PkgNameVerPeer
KSXGitHub Sep 25, 2023
63eefdb
test: PkgNameVerPeer
KSXGitHub Sep 25, 2023
90cee6e
feat: use PkgNameVerPeer
KSXGitHub Sep 25, 2023
e72ab74
feat: add an error variant
KSXGitHub Sep 25, 2023
68bc5ee
docs: add examples
KSXGitHub Sep 25, 2023
1dd5d77
test: mirrors the docs
KSXGitHub Sep 25, 2023
d5a121e
docs: fix
KSXGitHub Sep 25, 2023
87abdf5
refactor: move PkgVerPeer to its own mod
KSXGitHub Sep 26, 2023
dc5a03d
feat: change type of LockfileDependency::version
KSXGitHub Sep 26, 2023
8eb8c39
docs: update
KSXGitHub Sep 26, 2023
409fb79
feat: expose some fields
KSXGitHub Sep 26, 2023
0d8a263
refactor: rename
KSXGitHub Sep 26, 2023
6f6192e
refactor: type alias
KSXGitHub Sep 26, 2023
629d3f0
docs: add
KSXGitHub Sep 26, 2023
f2d658f
refactor: rename
KSXGitHub Sep 26, 2023
ee4dd88
refactor: fix mod name
KSXGitHub Sep 26, 2023
478f095
docs: fix link
KSXGitHub Sep 26, 2023
ff8aa2a
feat: remove bundledDependencies from group
KSXGitHub Sep 26, 2023
08f6fe9
feat: bundleDependencies, bundledDependencies
KSXGitHub Sep 26, 2023
817f920
feat: add some code (wip)
KSXGitHub Sep 26, 2023
c1bda65
feat: derive Eq and PartialEq
KSXGitHub Sep 26, 2023
c1f57a0
fix: serde
KSXGitHub Sep 26, 2023
c6a41be
test: BundleDependencies
KSXGitHub Sep 26, 2023
b96f67e
feat: iterate over lockfile's list of dependencies
KSXGitHub Sep 26, 2023
da9796d
refactor: create dedicated mods
KSXGitHub Sep 26, 2023
7cca01b
feat: return None for Peer
KSXGitHub Sep 26, 2023
32dbaee
test: ProjectSnapshot::dependencies_by_groups
KSXGitHub Sep 26, 2023
8ef3940
refactor: clearer names
KSXGitHub Sep 26, 2023
666879e
feat: revert the unnecessary change
KSXGitHub Sep 26, 2023
8e701f2
docs: add a todo
KSXGitHub Sep 26, 2023
bbe6db7
feat: more skeletons (wip)
KSXGitHub Sep 26, 2023
99937a1
feat: DependencyPath::to_store_name
KSXGitHub Sep 26, 2023
d51b29c
test: add some tests
KSXGitHub Sep 26, 2023
96b7cb3
refactor: consistency
KSXGitHub Sep 26, 2023
a37679d
refactor: rename
KSXGitHub Sep 27, 2023
b9b930f
test: prerelease cases
KSXGitHub Sep 27, 2023
4f140b1
refactor: explicit is better than implicit
KSXGitHub Sep 27, 2023
dcf7bed
feat: more skeletons (wip)
KSXGitHub Sep 27, 2023
9f9d01c
feat(install): more skeletons (wip)
KSXGitHub Sep 27, 2023
96b41a0
feat(install): change of plan
KSXGitHub Sep 27, 2023
efbb96d
feat(install): create_virtual_store (wip)
KSXGitHub Sep 27, 2023
b47572f
feat(install): link_direct_dependencies (wip)
KSXGitHub Sep 27, 2023
6ed1e0a
docs: add a reminder
KSXGitHub Sep 27, 2023
52b4c37
docs: bug
KSXGitHub Sep 27, 2023
1b751fa
feat: link_direct_dependencies
KSXGitHub Sep 27, 2023
3fa65a6
docs: differences in symlink targets
KSXGitHub Sep 27, 2023
5aa2910
refactor(install): remove the old wip code
KSXGitHub Sep 27, 2023
c1e0d28
feat(install): reduce complication
KSXGitHub Sep 27, 2023
5e59551
refactor(install): remove old wip code
KSXGitHub Sep 27, 2023
4117e77
docs: ask a question
KSXGitHub Sep 28, 2023
246572c
feat(lockfile): expose fields of PackageSnapshot
KSXGitHub Sep 28, 2023
4675c12
feat(install): more skeletons (wip)
KSXGitHub Sep 28, 2023
1d03f6c
feat(install): add more code (wip)
KSXGitHub Sep 28, 2023
46de35f
fix(install): forgot await
KSXGitHub Sep 28, 2023
e767a79
refactor: consistent naming
KSXGitHub Sep 28, 2023
254b1ca
feat(install): make sure same name
KSXGitHub Sep 28, 2023
c88e482
feat(install): install_virtdir_by_snapshot (wip)
KSXGitHub Sep 28, 2023
acc1a09
feat(lockfile): specify syntax of `dependencies`
KSXGitHub Sep 28, 2023
97dfc5b
feat(install): install_virtdir_by_snapshot
KSXGitHub Sep 28, 2023
2887279
feat(npmrc): derives some traits for import method
KSXGitHub Sep 28, 2023
82424c2
feat(install): complete a function
KSXGitHub Sep 28, 2023
856b6ba
fix: forgot a question mark
KSXGitHub Sep 28, 2023
004e681
refactor: remove an unused parameter
KSXGitHub Sep 28, 2023
c93dcae
feat(install): complete the feature (hopefully)
KSXGitHub Sep 28, 2023
b803120
fix: parent dir not exist
KSXGitHub Sep 28, 2023
824e2f9
fix: create parents for scope packages
KSXGitHub Sep 28, 2023
7838d3a
refactor: use par_iter
KSXGitHub Sep 28, 2023
379838f
feat(install): parallelize symlink creation
KSXGitHub Sep 28, 2023
fac424a
refactor: remove unnecessary async
KSXGitHub Sep 28, 2023
1b5988c
fix(lockfile): type of PackageSnapshot::deprecated
KSXGitHub Sep 29, 2023
1aeb0d5
refactor: remove PkgVerPeer::new_unchecked
KSXGitHub Sep 29, 2023
49b5b03
feat(lockfile): more structure to PkgVerPeer
KSXGitHub Sep 29, 2023
3833e27
fix(install): resolved peers
KSXGitHub Sep 29, 2023
0a179ec
docs: ParsePkgVerPeerError
KSXGitHub Sep 29, 2023
5fc72be
test: PkgVerPeer
KSXGitHub Sep 29, 2023
4434e12
docs: add a TODO
KSXGitHub Sep 29, 2023
0e705e5
feat(install): don't fetch json from registry
KSXGitHub Sep 29, 2023
6d09448
fix(install): tarball URLs for scoped packages
KSXGitHub Sep 29, 2023
4fb1ddb
docs: known bug
KSXGitHub Sep 29, 2023
45081ec
test: log the error before assert match
KSXGitHub Sep 29, 2023
01bf003
feat(lockfile): PackageSnapshotDependency
KSXGitHub Sep 29, 2023
a4c8689
feat(lockfile): make PackageSnapshot::dev optional
KSXGitHub Sep 29, 2023
2084931
feat(lockfile): allow unknown fields
KSXGitHub Sep 29, 2023
8d7f404
docs: cancel a TODO
KSXGitHub Sep 30, 2023
d119643
refactor: CliDependencyOptions
KSXGitHub Oct 1, 2023
7c2fdd8
docs: InstallCommandArgs::dependency_options
KSXGitHub Oct 1, 2023
fbed3e5
feat: --frozen-lockfile
KSXGitHub Oct 1, 2023
c0d8e73
docs: add a TODO
KSXGitHub Oct 1, 2023
523f6b3
feat: add frozen-lockfile to the benchmark
KSXGitHub Oct 1, 2023
3dd9227
feat(benchmark): pnpm-lock.yaml
KSXGitHub Oct 1, 2023
67db65b
feat(benchmark): --with-pnpm (wip)
KSXGitHub Oct 1, 2023
a9db975
feat(benchmark): inform about creating .npmrc
KSXGitHub Oct 1, 2023
04ff7c4
feat(benchmark): --with-pnpm
KSXGitHub Oct 1, 2023
d7be922
feat(benchmark): --show-output
KSXGitHub Oct 1, 2023
5913e6c
feat(benchmark): validate revision names
KSXGitHub Oct 1, 2023
a0d14ce
docs: update benchmark guide
KSXGitHub Oct 1, 2023
3973c69
docs(benchmark): --with-pnpm
KSXGitHub Oct 1, 2023
560bf87
feat(benchmark): add ignore-scripts to .npmrc
KSXGitHub Oct 1, 2023
2e311e7
docs: correct a heading
KSXGitHub Oct 2, 2023
0105b8f
docs: add a TODO
KSXGitHub Oct 2, 2023
09cce30
refactor: move to_virtual_store_name
KSXGitHub Oct 2, 2023
3a01e98
refactor: rename a function
KSXGitHub Oct 2, 2023
f8034d2
feat(lockfile): PkgName
KSXGitHub Oct 2, 2023
a8043e9
feat: make use of PkgName
KSXGitHub Oct 2, 2023
2d4a103
refactor(lockfile): rename a field
KSXGitHub Oct 2, 2023
34a451e
docs(lockfile): change some documentation
KSXGitHub Oct 2, 2023
3530acf
refactor: remove useless variables
KSXGitHub Oct 2, 2023
33cca86
feat(benchmark): use same settings for cache init
KSXGitHub Oct 2, 2023
2d25009
feat(benchmark): pnpm must always exist
KSXGitHub Oct 2, 2023
57f2996
refactor(benchmark): ensure_program
KSXGitHub Oct 2, 2023
c4c0b30
feat(benchmark): check for all needed programs
KSXGitHub Oct 2, 2023
ca2078e
refactor(test): use functions more
KSXGitHub Oct 2, 2023
b0c2baf
fix(docs): spelling
KSXGitHub Oct 2, 2023
6fda6e9
feat(benchmark): rename --task to --category
KSXGitHub Oct 3, 2023
ba3d2e2
feat(lockfile): skip serializing more `None`s
KSXGitHub Oct 3, 2023
ad2d097
docs: add a TODO
KSXGitHub Oct 3, 2023
6353b49
feat(lockfile): replace old TODOs with fields
KSXGitHub Oct 3, 2023
b73d1c9
refactor: extract duplicated code into a function
KSXGitHub Oct 3, 2023
e2fdead
feat(install): TarballResolution
KSXGitHub Oct 3, 2023
7e55542
style: merge imports
KSXGitHub Oct 3, 2023
7318ce8
feat(benchmark): rename --category to --scenario
KSXGitHub Oct 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 98 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pacquet_diagnostics = { path = "crates/diagnostics" }
async-recursion = { version = "1.0.5" }
clap = { version = "4", features = ["derive", "string"] }
dashmap = { version = "5.5.3" }
derive_more = { version = "0.99.17" }
home = { version = "0.5.5" }
insta = { version = "1.31.0", features = ["yaml", "glob", "walkdir"] }
itertools = { version = "0.11.0" }
Expand All @@ -42,14 +43,17 @@ serde = { version = "1.0.188", features = ["derive"] }
serde_ini = { version = "0.2.0" }
serde_json = { version = "1.0.107", features = ["preserve_order"] }
serde_yaml = { version = "0.9.1" }
split-first-char = { version = "0.0.0" }
ssri = { version = "9.0.0" }
strum = { version = "0.25.0", features = ["derive"] }
tar = { version = "0.4.40" }
text-block-macros = { version = "0.1.1" }
thiserror = { version = "1.0.48" }
tracing = { version = "0.1.37" }
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] }
walkdir = { version = "2.4.0" }
which = { version = "4.4.2" }
zune-inflate = { version = "0.2.54" }


Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TRACE=pacquet_tarball just cli add fastify

## Benchmarking

### Clean install between multiple revisions
### Install between multiple revisions

First, you to start a local registry server, such as [verdaccio](https://verdaccio.org/):

Expand All @@ -35,12 +35,22 @@ Then, you can use the script named `benchmark-install-against-revisions` to run

```sh
# Comparing the branch you're working on against main
cargo benchmark-install-against-revisions my-branch main
cargo benchmark-install-against-revisions --scenario=frozen-lockfile my-branch main
```

```sh
# Comparing current commit against the previous commit
cargo benchmark-install-against-revisions HEAD HEAD~
cargo benchmark-install-against-revisions --scenario=frozen-lockfile HEAD HEAD~
```

```sh
# Comparing pacquet of current commit against pnpm
cargo benchmark-install-against-revisions --scenario=frozen-lockfile --with-pnpm HEAD
```

```sh
# Comparing pacquet of current commit, pacquet of main, and pnpm against each other
cargo benchmark-install-against-revisions --scenario=frozen-lockfile --with-pnpm HEAD main
```

```sh
Expand Down
1 change: 1 addition & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ path = "src/bin/main.rs"
[dependencies]
pacquet_cafs = { workspace = true }
pacquet_executor = { workspace = true }
pacquet_lockfile = { workspace = true }
pacquet_npmrc = { workspace = true }
pacquet_package_json = { workspace = true }
pacquet_registry = { workspace = true }
Expand Down
Loading