All new code requires tests to ensure against regressions.
However, if your PR contains zero code changes, feel free to select the checkmark below to indicate so.
[X] Have you ran tests against this code?
[ ] This PR contains zero code changes.
Description of the Change
When publishing a new package version there is an optional query parameter of rename that can be accepted.
During original research into the backend the belief was this was a string based boolean such as rename=true or rename=false.
But seeing as how the --rename flag of PPM functions, it seems that this command will actually modify the package.json with the text used after the CLI flag. And append it as a query parameter with the same value.
Such as using pulsar -p publish --rename titanium will translate to ?rename=titanium.
So this PR changes how the rename query parameter is parsed.
Since the backend still is able to resolve the new name of a package by finding the name listed in the package.json of the remote package, we can keep the changes minimal for now. Instead parsing this properly to accept any string based value with a length more than 0 as setting rename true.
So technically using rename=a will successfully cause the backend to rename a package to whatever is listed in the package.json. Of course this shouldn't be recommended as the goal would be to fix this in future updates to the package-backend. But this does allow this flag to function as expected for now.
Requirements
Filling out the template is required.
All new code requires tests to ensure against regressions.
[X] Have you ran tests against this code?
[ ] This PR contains zero code changes.
Description of the Change
When publishing a new package version there is an optional query parameter of
rename
that can be accepted.During original research into the backend the belief was this was a string based boolean such as
rename=true
orrename=false
.But seeing as how the
--rename
flag of PPM functions, it seems that this command will actually modify thepackage.json
with the text used after the CLI flag. And append it as a query parameter with the same value.Such as using
pulsar -p publish --rename titanium
will translate to?rename=titanium
.So this PR changes how the
rename
query parameter is parsed.Since the backend still is able to resolve the new name of a package by finding the
name
listed in thepackage.json
of the remote package, we can keep the changes minimal for now. Instead parsing this properly to accept any string based value with a length more than0
as settingrename
true.So technically using
rename=a
will successfully cause the backend to rename a package to whatever is listed in thepackage.json
. Of course this shouldn't be recommended as the goal would be to fix this in future updates to thepackage-backend
. But this does allow this flag to function as expected for now.Resolves #108