Skip to content

chore: fix modern npm and Windows dev workflow#352

Open
JCDuann wants to merge 1 commit into
greena13:masterfrom
JCDuann:chore/modern-npm-windows-workflow
Open

chore: fix modern npm and Windows dev workflow#352
JCDuann wants to merge 1 commit into
greena13:masterfrom
JCDuann:chore/modern-npm-windows-workflow

Conversation

@JCDuann

@JCDuann JCDuann commented May 31, 2026

Copy link
Copy Markdown

Summary

This makes the local development workflow work reliably with modern npm and on Windows:

  • adds the standard npm test script alias while preserving the existing npm run tests
  • replaces rm -rf in build scripts with rimraf so build cleanup works cross-platform
  • changes the deprecated prepublish lifecycle script to prepublishOnly and adds an explicit build script
  • pins Enzyme's Cheerio dependency to a compatible prerelease via npm overrides and Yarn resolutions
  • updates the test setup to define global.navigator in a way that works on modern Node versions

Why

On a clean Windows checkout with modern npm/Node:

  • npm install was invoking prepublish, then failing because rm is not available on Windows.
  • npm test was missing.
  • the test suite failed before running because npm resolved Enzyme's nested Cheerio dependency to a newer version with package exports.
  • after fixing Cheerio, modern Node exposed global.navigator as a getter, so direct assignment failed in test/setup.js.

Verification

  • npm install --legacy-peer-deps --package-lock=false
  • npm test -> 2102 passing
  • npm run build-cjs

@JCDuann JCDuann marked this pull request as ready for review May 31, 2026 05:10
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