The upload command in the PxPlus Package Manager is used to upload your package or a new package version to the server. It creates a ZIP archive from your current project directory (while excluding certain files and directories), uploads it for validation, and then stores it if everything is in order.
{warning} If you are not yet familiar with the required package structure, we highly recommend checking out the package management documentation. All the same rules apply here when uploading a package via the command line.
upload [upload_type]
package: For uploading a new package.version: For uploading a new version of an existing package.When you run the upload command, the following steps occur:
Package Presence Validation:
It looks for a package.json file in the current directory to ensure that package details are available.
Package Archive Creation:
It creates a temporary ZIP archive of the current directory. During this process:
vendor folder and the package-lock.json file are excluded.Package Upload and Validation:
The archive is uploaded to the server. The server then:
packageversionupload package
upload version
Success:
If the upload is successful, you will see messages confirming that the package has been uploaded, validated, and stored. The output may also include the package name, version, and a URL to view the package.
Failure:
If an error occurs (such as missing parameters, API inaccessibility, failed validation, etc.), an appropriate error message will be displayed.
CommandNoParametersException:
Thrown if the upload_type parameter is missing or invalid.
NoApiAccessException:
Thrown if the API is not accessible.
Other Exceptions:
Exceptions may also occur during file operations (e.g., creating the ZIP archive) or API communication. These will be logged with appropriate error messages.