You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The VersionUtils which logs the version of the CLI in the console, has the path of the required package.json wrong when trying to install it globally. The reason this is working locally is because of the fact that the directory locally is structured that way that when you go up in the tree from dist, you will also find the original package.json there.
Special notes
Unpublished the 1.0.1 version that was published with a faulty path. Merging this will re-publish it.
Checklist
I have self-reviewed this PR
I have tested the change and proved that it works in different scenarios
The initial solution of this PR was working for both global and local installations, but was failing the tests in which the location of package.json is pretty different. As a solution added the package-up package, which is a simple tool for finding the closest package.json.
Note: since the tool does async file reading, had to do some minor refactorings in the content-cli.ts file to fit the async changes.
The initial solution of this PR was working for both global and local installations, but was failing the tests in which the location of package.json is pretty different. As a solution added the package-up package, which is a simple tool for finding the closest package.json.
Note: since the tool does async file reading, had to do some minor refactorings in the content-cli.ts file to fit the async changes.
Checked the library a bit, the implementation is kinda simple, I don't think we should use a library for these checks.
In the tests maybe we should see if we can mock the version util or something like that
The initial solution of this PR was working for both global and local installations, but was failing the tests in which the location of package.json is pretty different. As a solution added the package-up package, which is a simple tool for finding the closest package.json.
Note: since the tool does async file reading, had to do some minor refactorings in the content-cli.ts file to fit the async changes.
Update: used the already existing find-up dependency, with no need to add another package.
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
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.
Description
The VersionUtils which logs the version of the CLI in the console, has the path of the required
package.jsonwrong when trying to install it globally. The reason this is working locally is because of the fact that the directory locally is structured that way that when you go up in the tree fromdist, you will also find the originalpackage.jsonthere.Special notes
Unpublished the 1.0.1 version that was published with a faulty path. Merging this will re-publish it.
Checklist