feat!: rewrite as a pure ESM package (Node.js >= 18)#40
Merged
Conversation
d6c2257 to
fc575ea
Compare
Modernizes the project for the first 1.0 release: - Pure ESM with default and named exports (import pidtree from 'pidtree') - Drops CommonJS and Node.js < 18 - Refreshed toolchain: ava 6, c8, xo 2, tsd; tests use dependency injection and a shared parser instead of mockery and stream mocks - Keeps the Windows wmic -> PowerShell fallback and zero runtime deps BREAKING CHANGE: pidtree is now ESM-only and requires Node.js >= 18. CommonJS consumers and older Node.js should stay on pidtree@0.6. Co-Authored-By: Gavin Aiken <gavin.aiken@netcuras.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of the renewal: the first 1.0.0, a pure-ESM rewrite. This is a deliberate breaking change — it ships as a major version, so the millions of
^0.6consumers are unaffected until they opt in.Highlights
import pidtree from 'pidtree'andimport {pidtree} from 'pidtree'both work.engines: >=18,exportsmap).0.25→8,nyc→c8,xo→2, updated tsd; removednp/npm-check/mockery/pify/stream-mock deps.parse()and dependency injection replace themockery+ fake-stream machinery, so tests need no ESM-loader hacks. Still zero runtime dependencies.0no longer reports "No matching pid found".CI / tooling
tsd) re-enabled in CI; matrix is Node 18–current on Linux/macOS/Windows (Server 2025, which exercises the PowerShell fallback).Notes
package.json).pidtree,--list).Merging this lets release-please cut the
1.0.0release (thefeat!commit drives the major bump), which auto-publishes via the now-working OIDC pipeline.A short migration note is in the readme: CommonJS / older-Node users stay on
pidtree@0.6.