mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-02 11:55:17 -04:00
* chore(pacquet): fold registry-mock into root workspace, fix npm metadata
Two unrelated cleanups bundled because they touch the same publishing/
workspace plumbing:
1. **`pacquet/npm/pacquet/package.json` metadata** — the imported file
still pointed at the standalone repo: `repository.url` was
`pnpm/pacquet`, `repository.directory` was `npm/pacquet`, `homepage`
and `bugs` likewise. Repoint at `pnpm/pnpm`. Update
`generate-packages.mjs` so the per-platform packages it emits at
release time also point at `pnpm/pnpm`.
2. **Fold `pacquet/tasks/registry-mock` into the root pnpm workspace**.
Pacquet's standalone-repo nested-workspace setup pinned
`nodeLinker: hoisted` "for verdaccio CJS resolution," but pnpm's
own jest globalSetup (`__utils__/jest-config/with-registry/`) calls
the same `@pnpm/registry-mock.start()` API under the default
isolated linker without issue, and verified locally that
`node launch.mjs prepare` works after consolidation. The hoisted
constraint was scoped to standalone-pacquet's install pattern; in
the monorepo it's unnecessary.
Changes for (2):
- Add `pacquet/tasks/registry-mock` to `pnpm-workspace.yaml`.
- Rename the package `@pnpm-private/pacquet-registry-mock-launcher`
(private, matches the `@pnpm-private/*` convention used by other
internal workspace members) and switch `@pnpm/registry-mock` to
`catalog:` (the root catalog already pins it at 6.0.0).
- Delete `pacquet/tasks/registry-mock/pnpm-lock.yaml` and
`pnpm-workspace.yaml` — root install handles both now.
- Delete `pacquet/package.json` and `pacquet/pnpm-lock.yaml` — the
file only had a `cargo build` script + `devEngines: pnpm`, both
already covered by root, and nothing referenced it.
- `justfile install` is now just `pnpm install` (was
`cd pacquet/tasks/registry-mock && pnpm install --frozen-lockfile`).
- `pacquet-integrated-benchmark.yml` path filter and cache key
swap the deleted nested lockfile for the root `pnpm-lock.yaml` /
`pnpm-workspace.yaml`.
Verified: `pnpm install` resolves the workspace member, the lockfile
gains a `pacquet/tasks/registry-mock` importer entry, and
`pacquet/tasks/registry-mock/node_modules/@pnpm/registry-mock` is
linked correctly under the isolated layout.
* fix(pacquet): match meta-updater conventions in registry-mock launcher
The previous version of `pacquet/tasks/registry-mock/package.json`
omitted `version`, which crashed `pn lint:meta` (meta-updater hits
`manifest.version!.split('.')[0]` for every workspace package).
Backfill all the fields meta-updater would emit for an internal
`@pnpm-private/*` private package, matching `__typecheck__/package.json`
and friends:
- `version: 1100.0.0` (the pnpm 11.x convention for non-experimental
internal packages)
- self-devDep entry (`workspace:*`) that meta-updater would otherwise
inject
- `keywords: [pnpm, pnpm11]`
- `repository` pointing at this directory inside pnpm/pnpm
This is the same shape every other `@pnpm-private/*` private workspace
member uses; it lets `pn lint:meta --test` pass without modifying the
file.
* fix: update lockfile
* chore(pacquet): add build:pacquet script at root
Restore the `cargo build --release --bin pacquet` shortcut that lived in
the deleted `pacquet/package.json`. Naming it `build:pacquet` (rather
than `build`) matches the existing namespacing convention in this
file (`lint:ts`, `lint:meta`) and leaves room for a general `build`
script later. Invoke with `pnpm build:pacquet` or `pn build:pacquet`
from the repo root.
96 lines
2.4 KiB
Makefile
96 lines
2.4 KiB
Makefile
#!/usr/bin/env -S just --justfile
|
|
|
|
_default:
|
|
just --list -u
|
|
|
|
alias r := ready
|
|
alias c := codecov
|
|
alias t := test
|
|
|
|
# Initialize the project by installing all the necessary tools.
|
|
# Make sure you have cargo-binstall installed.
|
|
# You can download the pre-compiled binary from <https://github.com/cargo-bins/cargo-binstall#installation>
|
|
# or install via `cargo install cargo-binstall`
|
|
init:
|
|
cargo binstall cargo-nextest cargo-watch cargo-insta typos-cli taplo-cli wasm-pack cargo-llvm-cov -y
|
|
just install-hooks
|
|
|
|
# Point git at pacquet/.githooks/ so the tracked pre-push format check runs on `git push`.
|
|
install-hooks:
|
|
git config core.hooksPath pacquet/.githooks
|
|
|
|
# When ready, run the same CI commands
|
|
ready:
|
|
typos
|
|
cargo fmt
|
|
just check
|
|
just test
|
|
just lint
|
|
git status
|
|
|
|
# Update our local branch with the remote branch (this is for you to sync the submodules)
|
|
update:
|
|
git pull
|
|
git submodule update --init
|
|
|
|
# Install necessary dependencies.
|
|
# `pacquet/tasks/registry-mock` is a member of the root pnpm workspace,
|
|
# so the root install populates its node_modules.
|
|
install:
|
|
pnpm install --frozen-lockfile --prefer-offline
|
|
|
|
# Run `cargo watch`
|
|
# --no-vcs-ignores: cargo-watch has a bug loading all .gitignores, including the ones listed in .gitignore
|
|
# use .ignore file getting the ignore list
|
|
watch command:
|
|
cargo watch --no-vcs-ignores -x '{{command}}'
|
|
|
|
# Format all files
|
|
fmt:
|
|
cargo fmt
|
|
taplo format
|
|
|
|
# Run cargo check
|
|
check:
|
|
cargo check --locked
|
|
|
|
# Run all the tests
|
|
test:
|
|
cargo nextest run
|
|
|
|
# List expected-failing test ports
|
|
[unix]
|
|
known-failures:
|
|
@cargo test --workspace known_failures -- --list 2>/dev/null | rg '^known_failures::'
|
|
|
|
[windows]
|
|
known-failures:
|
|
@cargo test --workspace known_failures -- --list 2>nul | rg '^known_failures::'
|
|
# Lint the whole project
|
|
lint:
|
|
cargo clippy --locked -- --deny warnings
|
|
|
|
# Run perfectionist dylint rules. Requires `cargo-dylint` and `dylint-link`
|
|
# (install with `cargo binstall cargo-dylint dylint-link`). The lint library
|
|
# is pinned in `dylint.toml`.
|
|
dylint:
|
|
env RUSTFLAGS="-D warnings" cargo dylint --all -- --all-targets --workspace
|
|
|
|
# Get code coverage
|
|
codecov:
|
|
cargo codecov --html
|
|
|
|
# Run the benchmarks. See `tasks/benchmark`
|
|
micro-benchmark:
|
|
cargo run --bin=micro-benchmark --release
|
|
|
|
# Manage registry-mock
|
|
registry-mock +args:
|
|
cargo run --bin=pacquet-registry-mock -- {{args}}
|
|
|
|
integrated-benchmark +args:
|
|
cargo run --bin=integrated-benchmark -- {{args}}
|
|
|
|
cli +args:
|
|
cargo run --bin pacquet -- {{args}}
|