fix: remove get-package-info and resolve dependencies#1906
Merged
MarshallOfSound merged 1 commit intomainfrom Apr 22, 2026
Merged
fix: remove get-package-info and resolve dependencies#1906MarshallOfSound merged 1 commit intomainfrom
MarshallOfSound merged 1 commit intomainfrom
Conversation
e7f8801 to
c435d52
Compare
Replaces get-package-info with a small async generator that walks up the directory tree yielding parsed package.json files, and reads the needed fields (productName/name, version, author, electron dep) directly with optional chaining instead of dot-path string lookup. Replaces the resolve package with createRequire().resolve() for locating the electron package.json during version inference. Drops ~35 transitive production dependencies including bluebird, lodash.get, read-pkg-up, normalize-package-data, and the spdx-* tree.
c435d52 to
9cea383
Compare
erickzhao
approved these changes
Apr 22, 2026
Member
erickzhao
left a comment
There was a problem hiding this comment.
Neat, enjoying the new control flow on this one!
|
🎉 This PR is included in version 19.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Replaces
get-package-infowith a small async generator ininfer.tsthat walks up the directory tree yielding parsedpackage.jsonfiles.getMetadataFromPackageJSONreads the needed fields (productName/name,version,author,dependencies.electron/devDependencies.electron/*-nightly) directly with optional chaining — no more dot-path-string lookup, no intermediateresult.values['dependencies.electron']indirection, and no catch-and-reinterpret of a custom error type.Also replaces the
resolvepackage withcreateRequire(src).resolve()for locating theelectron/electron-nightlypackage.jsonduring version inference.Drops ~35 transitive packages from the production install tree (roughly 27%), including
bluebird,lodash.get,debug@2,read-pkg-up,normalize-package-data,hosted-git-info,semver@5, and thespdx-*/validate-npm-package-licensechain.Notes
import.meta.resolvewas not used because its two-argumentparentform is still behind--experimental-import-meta-resolve; without the flag the second argument is silently ignored, which would resolve from the wrong directory.createRequire().resolve()is the stable equivalent.require.resolvehonors theexportsfield while theresolvepackage did not.electronandelectron-nightlyhave noexportsfield, so this has no effect today.package.jsonreads is retained for parity with the oldload-json-filedependency.Also removes the now-unused
src/ambient.d.tsand the staleget-package-infoDEBUG namespace reference fromCONTRIBUTING.md.