Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion scripts/package-count.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ infer_package_manager() {
elif [[ -f "vlt-lock.json" ]]; then
echo "vlt"
elif [[ -f "pnpm-lock.yaml" ]]; then
echo "pnpm"
# pnpm (v11, TypeScript) and pacquet (pnpm v12, Rust) both leave a
# pnpm-lock.yaml, so the lockfile alone can't tell them apart. The
# installer records its own version in node_modules/.modules.yaml
# (packageManager: pnpm@<version>); v12+ is pacquet.
pnpm_major=$(sed -n "s/^packageManager: ['\"]\{0,1\}pnpm@\([0-9][0-9]*\).*/\1/p" node_modules/.modules.yaml 2>/dev/null | head -1)
if [[ -n "$pnpm_major" && "$pnpm_major" -ge 12 ]]; then
echo "pacquet"
else
echo "pnpm"
fi
elif [[ -f "yarn.lock" ]]; then
if [[ -f ".yarnrc.yml" ]] && command -v yarn >/dev/null 2>&1; then
yarn_version=$(yarn -v 2>/dev/null || echo "")
Expand Down
7 changes: 5 additions & 2 deletions scripts/variations/lockfile+node_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ set -Eeuxo pipefail
# Load common variables
source "$1/variations/common.sh"

# Prepare command base for each run
BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_package_manager_files"
# Prepare command base for each run.
# clean_package_manager_field must run AFTER clean_all_cache: the corepack
# yarn cache cleans re-pin devEngines.packageManager (yarn) into package.json,
# which makes npm and pnpm refuse to run entirely (see clean_all).
BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_package_manager_files clean_package_manager_field"

# Run the benchmark suite
# When running a cache benchmark, we want to clean up only the node_modules
Expand Down
7 changes: 5 additions & 2 deletions scripts/variations/lockfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ set -Eeuxo pipefail
# Load common variables
source "$1/variations/common.sh"

# Prepare command base for each run
BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_node_modules clean_package_manager_files"
# Prepare command base for each run.
# clean_package_manager_field must run AFTER clean_all_cache: the corepack
# yarn cache cleans re-pin devEngines.packageManager (yarn) into package.json,
# which makes npm and pnpm refuse to run entirely (see clean_all).
BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_node_modules clean_package_manager_files clean_package_manager_field"

# Run the benchmark suite
# When running a cache benchmark, we want to clean up only the node_modules
Expand Down
7 changes: 5 additions & 2 deletions scripts/variations/node_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ set -Eeuxo pipefail
# Load common variables
source "$1/variations/common.sh"

# Prepare command base for each run
BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_lockfiles clean_package_manager_files"
# Prepare command base for each run.
# clean_package_manager_field must run AFTER clean_all_cache: the corepack
# yarn cache cleans re-pin devEngines.packageManager (yarn) into package.json,
# which makes npm and pnpm refuse to run entirely (see clean_all).
BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_lockfiles clean_package_manager_files clean_package_manager_field"

# Run the benchmark suite
# When running a cache benchmark, we want to clean up only the node_modules
Expand Down
Loading