Skip to content

test: guard package manager parity#589

Closed
JustYannicc wants to merge 115 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-wave4-package-manager-parity
Closed

test: guard package manager parity#589
JustYannicc wants to merge 115 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-wave4-package-manager-parity

Conversation

@JustYannicc

@JustYannicc JustYannicc commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Added a package-manager parity check that treats package-lock.json as authoritative, rejects pnpm lifecycle/runtime markers, rejects root pnpm-lock.yaml, validates root dependency spec parity, and compares installed package versions against the npm lockfile when node_modules is present.
  • Wired the parity check into validation scripts before tests, i18n, main build, renderer typecheck, and renderer build.
  • Added node:test coverage for npm parity, pnpm runtime blocking, generated pnpm lock blocking, package spec drift, and installed-version drift.
  • Ignored root pnpm-lock.yaml so generated pnpm locks cannot be accidentally swept into normal PR staging.

Why

macOS local npm may be a shim that delegates to pnpm, which can generate an untracked root pnpm-lock.yaml and install dependency versions that differ from CI npm ci. The guard makes that drift visible or blocks the validation path before local results diverge from the committed npm lockfile.

Compatibility impact

Developer validation only. App runtime behavior and production code paths are unchanged.

How tested

  • Before/base reproduction on 206eab8280a2eb91a57e4e74ea6df99e45a55cb4: /usr/bin/time -p npm test used the disabled macOS npm shim, printed npm is intentionally disabled on this Mac. Using pnpm instead., passed in 12.30s, generated untracked pnpm-lock.yaml, and installed @raycast/api 1.104.21 while package-lock.json expected 1.104.19.
  • Before/base real npm validation with PATH=/opt/homebrew/opt/node@22/bin:...: npm ci 8.16s, npm test 4.79s, npm run check:i18n 0.16s, npm run build:main 1.44s, tsc -p tsconfig.main.json --noEmit --pretty false 1.06s, npm run typecheck:renderer 3.24s, npm run build:renderer 4.54s.
  • After shim reproduction: /usr/bin/time -p npm test failed fast in 0.24s with This project is configured to use npm, exit 1, and no root pnpm-lock.yaml was created.
  • After real npm validation with PATH=/opt/homebrew/opt/node@22/bin:...: npm ci 8.03s, npm run check:package-manager 0.17s after install and checked 584 installed package versions, npm test 4.89s, npm run check:i18n 0.24s, npm run build:main 1.50s, tsc -p tsconfig.main.json --noEmit --pretty false 1.07s, npm run typecheck:renderer 3.33s, npm run build:renderer 4.60s.
  • Codex LSP: TypeScript server installed and used for touched .mjs scripts; no diagnostics found. eslint/biome LSP servers were unavailable, so LSP coverage did not include lint-rule diagnostics.

Performance evidence

The new parity prechecks add a small validation cost while blocking drift: direct post-install package-manager check completed in 0.17s across 584 installed package entries. After timings remained close to base real-npm timings: tests 4.89s vs 4.79s, i18n 0.24s vs 0.16s, build:main 1.50s vs 1.44s, renderer typecheck 3.33s vs 3.24s, renderer build 4.60s vs 4.54s.

Stack validation

  • Branch is based on codex/perf-wave3-integration-stack-20260704 at 206eab8280a2eb91a57e4e74ea6df99e45a55cb4.
  • Main process typecheck is clean via npm run build:main and explicit tsc -p tsconfig.main.json --noEmit --pretty false.
  • Renderer typecheck is clean via npm run typecheck:renderer.
  • Renderer production build is clean apart from existing Vite/Browserslist/chunk warnings.
  • No generated pnpm-lock.yaml, coordinator notes, prompts, or playbooks are included.

Replaces

  • Replaces the wave 4 package-manager shim / lockfile parity validation gap where local pnpm validation could drift from CI npm ci.

…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime-renderers.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/CameraExtension.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	scripts/bench-script-command-discovery.mjs
#	scripts/benchmark-file-search-delete-batch.mjs
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-file-search-delete-batch.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/file-search-index.ts
#	src/main/main.ts
…perf-wave2-integration-stack-20260704

# Conflicts:
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-extension-lifecycle-sandbox.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/main.ts
#	src/renderer/src/ExtensionView.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	.github/workflows/project-checks.yml
#	scripts/test-root-search-perf.mjs
#	src/renderer/src/CameraExtension.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…erf-wave3-integration-stack-20260704

# Conflicts:
#	package.json
#	scripts/measure-extension-bundle-cache.mjs
#	scripts/test-icon-runtime-file-icon-cache.mjs
#	src/main/extension-runner.ts
#	src/renderer/src/components/HiddenExtensionRunners.tsx
#	src/renderer/src/raycast-api/icon-runtime-render.tsx
…/perf-wave3-integration-stack-20260704

# Conflicts:
#	scripts/test-browser-search-performance.mjs
#	scripts/test-root-search-perf.mjs
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by #600, which consolidates the package-manager parity validation into the final npm-based project checks branch without pnpm artifacts.

@JustYannicc JustYannicc closed this Jul 5, 2026
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.

1 participant