Skip to content

fix: package-manager and pnpm support fixes #5265

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 7 commits into from
Feb 21, 2020

Conversation

rosen-vladimirov
Copy link
Contributor

This PR contains multiple fixes for package-manager issues and pnpm particularly:

fix: pnpm support should work on macOS and Linux

Currently we are unable to build applications on macOS and Linux when pnpm is set as package manager. The problem seems to be caused by the way pnpm produces files in node_modules and the way webpack expects them. However, the issue is resolved in case we do not pass --preserve-symlinks option to Node.js when starting the webpack process. According to docs (https://pnpm.js.org/en/faq) the preserve-symlinks does not work very well and pnpm does not require it.
So, to resolve the issue, skip the --preserve-symlinks option when pnpm is used. To achieve this, introduce a new method in the packageManager that returns the package manager used for the current process.
Fixes issue #5259

fix: CLI should print help of commands with dash in the name

When trying to print the help of a default hierarchical command, CLI expects the format of the command name to be <letters>|*<something else>. However, some commands have dash in the name, like tns package-manager get. Fix the expectation of the help service.
Fixes issue #5264

fix: help of package-manager commands does not list pnpm

The markdown files of package-manager commands does not list pnpm as supported value. Add it where is required and add help file for package-manager command (without passig get to it).
Fixes issue #5263

fix: register package-manager get as default hierarchical command

Register the package-manager get as default hierarchical command, so when you write tns package-manager we'll print the currently selected package-manager.
Fixes issue #5262

fix: print information message when package-manager is set

Currently when calling tns package-manager set <valid value> you do not see any output or information if the operation is successful. Add such message and clean the code from hardcoded strings.
Fixes issues #5260 #5261

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].

@rosen-vladimirov
Copy link
Contributor Author

test cli-smoke cli-misc

Currently we are unable to build applications on macOS and Linux when pnpm is set as package manager. The problem seems to be caused by the way pnpm produces files in node_modules and the way webpack expects them. However, the issue is resolved in case we do not pass `--preserve-symlinks` option to Node.js when starting the webpack process. According to docs (https://pnpm.js.org/en/faq) the preserve-symlinks does not work very well and pnpm does not require it.
So, to resolve the issue, skip the `--preserve-symlinks` option when pnpm is used. To achieve this, introduce a new method in the packageManager that returns the package manager used for the current process.
When trying to print the help of a default hierarchical command, CLI expects the format of the command name to be `<letters>|*<something else>`. However, some commands have dash in the name, like `tns package-manager get`. Fix the expectation of the help service.
The markdown files of package-manager commands does not list pnpm as supported value. Add it where is required and add help file for package-manager command (without passig get to it).
Register the package-manager get as default hierarchical command, so when you write `tns package-manager` we'll print the currently selected package-manager.
Currently when calling `tns package-manager set <valid value>` you do not see any output or information if the operation is successful. Add such message and clean the code from hardcoded strings.
@rosen-vladimirov rosen-vladimirov merged commit 5ab0d30 into release Feb 21, 2020
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-pnpm branch February 21, 2020 07:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants