Skip to content

fix: replace mkdirp with node's recursive mkdirSync - #248

Merged
unional merged 1 commit into
mainfrom
fix/drop-mkdirp
Sep 2, 2026
Merged

fix: replace mkdirp with node's recursive mkdirSync#248
unional merged 1 commit into
mainfrom
fix/drop-mkdirp

Conversation

@unional

@unional unional commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Closes the second, separate cause of fixture's red dependency PRs. (The first is #247@swc/core build approval, which blocks #235 at install. These are independent.)

Why #197 could not pass

mkdirp v3 removed the default export:

mkdirp v3 exports: manual, manualSync, mkdirp, mkdirpManual, mkdirpManualSync,
mkdirpNative, mkdirpNativeSync, mkdirpSync, native, nativeSync, sync,
useNative, useNativeSync

There is no default, so import mkdirp from 'mkdirp' has nothing to bind and the build fails. The renovate PR bumps the version without touching the two call sites, so it can never go green on its own.

Why drop it rather than migrate to mkdirpSync

mkdirp.sync has been a thin wrapper over fs.mkdirSync(path, { recursive: true }) since Node 10. ensureFolderExist() is the only caller in ts/, plus one in a spec. Removing the dependency:

Behaviour is identical.

Verification

pnpm verify with no mkdirp installed: 7 suites / 63 tests pass, coverage unchanged.

Patch changeset included, since this changes the published package's dependency list.

mkdirp v3 removed the default export, so the open renovate bump (#197) could
not compile: `import mkdirp from 'mkdirp'` has no binding to import. Rather
than migrate to the named `mkdirpSync` export, drop the dependency — `mkdirp.sync`
has been a wrapper over `fs.mkdirSync(path, { recursive: true })` since Node 10,
and `ensureFolderExist()` is the only caller in src.

Also removes the stale `@types/mkdirp` (v1 types, pinned against a v2 runtime).

Verified: 7 suites / 63 tests pass with no mkdirp installed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ETjy9oQGyETyFmDBdR9Egz
@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4e085ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@unional/fixture Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.19%. Comparing base (c74c00d) to head (4e085ac).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #248   +/-   ##
=======================================
  Coverage   97.19%   97.19%           
=======================================
  Files           9        9           
  Lines         321      321           
  Branches       86       87    +1     
=======================================
  Hits          312      312           
  Misses          9        9           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@unional
unional added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit c158777 Sep 2, 2026
10 checks passed
@unional
unional deleted the fix/drop-mkdirp branch September 2, 2026 16:09
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