npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dxpcloud-cli

v3.5.0

Published

CLI for Liferay DXP Cloud

Downloads

1

Readme

Liferay Cloud Platform CLI tool

Command line tool for Liferay DXP Cloud

Install

  1. For Mac and Linux:
curl https://cdn.liferay.cloud/lcp/stable/latest/install.sh -fsSL | bash
  1. For Windows:

Download the Windows installer from https://cdn.liferay.cloud/lcp/stable/latest/lcp-install.exe. Run the installer and follow the steps in the wizard.

Getting Started

Usage: lcp <cmd> [args]

Commands:
  lcp deploy  Deploy to DXP Cloud
  lcp docs    Open the documentation of DXP Cloud in your browser
  lcp list    Show list of projects and services
  lcp log     Show logs of project, service or instance
  lcp login   Login to DXP Cloud
  lcp logout  Logout from DXP Cloud
  lcp remote  Configure DXP Cloud remotes
  lcp restart Restart a DXP Cloud service
  lcp scale   Change the number of service instances
  lcp shell   Open a shell to a service
  lcp update  Update DXP Cloud CLI
  lcp version Show CLI version

Options:
  -v, --verbose  Show more information about an operation                                                      [boolean]
  --version      Show version number                                                                           [boolean]
  --help         Show help                                                                                     [boolean]

Development

  1. Clone the repo, then run:
$ npm i
  1. Run the program by executing:
$ ./bin/index.js <cmd> [args]
  1. Run the tests by executing:
$ npm run test

Releasing

  1. Build executable files by running npm run release . This will create binary files in dist folder.

  2. Preparing to push to the CDN

Execute node .update_cdn.js update. The following arguments are supported:

$ node .update_cdn.js update --help
.update_cdn.js update

Updates given channel with a new CLI version

Options:
  --version          Show version number                                                                       [boolean]
  --help             Show help                                                                                 [boolean]
  --channel          The channel to update                  [string] [choices: "stable", "unstable"] [default: "stable"]
  --cdn              CDN sources                                                    [string] [default: "../cdn/cli"]
  --cli-version      The CLI version to publish                                             [string] [default: "latest"]
  --package-version  The package version to specify                                          [string] [default: "1.0.0"]

Note: package-version value is read automatically from version property in package.json. It is not hardcoded.

This will update the CDN project with the new binary files. Then, deploy a new version of the CDN project.

Making installers and uninstallers

Build installers by executing node .make_installer.js make. The following arguments are supported:

$ node .make_installer.js make --help
.make_installer.js make

Generates an installer for the CLI

Options:
  --version           Show version number                                                                      [boolean]
  --help              Show help                                                                                [boolean]
  --platform          The target operating system                [string] [choices: "unix", "windows"] [default: "unix"]
  --channel           The channel to target                 [string] [choices: "stable", "unstable"] [default: "stable"]
  --cli-version       The CLI version to target                         [string] [choices: "latest"] [default: "latest"]
  --make-uninstaller  Whether to make the Windows uninstaller-generator binary                [boolean] [default: false]
  --unsigned          Generate the installer without signing                                  [boolean] [default: false]

This will generate an installer at /installers/< --platform >/dist/ using the current configuration found in /config/app.config.js and /config/installer.config.js.

UNIX-compatible installer and uninstaller

Installer

Run the following command:

node ./.make_installer.js make --platform unix

Then, retrieve the install.sh script from /installer/unix/dist/.

Uninstaller

Run the following command:

node ./.make_installer.js make --platform unix

Then, retrieve the uninstall.sh script from /installer/unix/dist/.

Windows installer and uninstaller

The Windows installer and uninstaller cannot be differentiated since the uninstaller is packaged in the installer. In other words, the installer delivers the uninstaller binary into the install location upon installation. So, in order for the Windows installer binary to be properly created, the uninstaller must be pre-generated and then inserted into the resources directory so that it can be packaged into the installer binary. This flow is necessary in the particular case that the code must be signed, since the uninstaller would not be signed if it were merely generated by the installer upon installation.

The uninstaller binary is pre-generated using an "uninstaller-generator" EXE file, which is actually a blank installer which writes the uninstaller binary when it's run. This allows the developer to insert the newly created uninstaller into the resources directory, where it can be packaged into the installer binary.

To create the uninstaller-generator file, the --make-uninstaller parameter must be set to true when running the .make_installer.js script. The uninstaller-generator file must then be executed on a Windows machine or VM not in a network drive in order to properly generate the uninstaller binary. The new uninstaller binary must then be placed in the resources directory. This is where it will be found by the NSIS compiler when running the lcp-cli-makeinstall script, which packages the uninstaller into the final installer binary. The lcp-cli-makeinstall script is executed by running .make_installer.js with --platform windows. The resulting Windows installer can then be found in the dist directory.

So, the steps for releasing a signed Windows installer are:

  1. Run .make_installer.js with --platform windows and --make-uninstaller true to generate a win-uninstaller-generator.exe file.
node ./.make_installer.js make --platform windows --make-uninstaller true
  1. On a Windows machine or VM, run win-uninstaller-generator.exe. If done correctly, a new uninstaller binary will be created. Make sure to run win-uninstaller-generator.exe in a non-network drive for it to work properly.
  2. Move the newly created uninstaller binary to the resources directory on your host machine.
  3. Run .make_installer.js with --platform windows to output the final, signed Windows installer in the dist directory.
node ./.make_installer.js make --platform windows

If you do not have access to the code signing certificate or wish to generate an unsigned Windows installer, run the following command:

node ./.make_installer.js make --platform windows --unsigned true

Note: Code signing can only be performed on MacOS and Linux machines at this time.

Note: Because the config files will be used to configure the installer, it is good to understand the relevant config variables that will be primarily used. They are listed below. These variables can be overridden in /config/installer.config.js.

  • appName: provides the name of the CLI to Windows
  • appVersion: from the package.json, provides the version of the CLI to Windows
  • binName: used by Windows and UNIX installers to specify the CLI binary
  • cdnHost: used by Windows and UNIX installers to reach CDN
  • cdnPathBase: used by Windows and UNIX installers to reach CDN
  • companyName: provides the name of the company to Windows
  • description: provides the CLI app description to Windows
  • docUrl: provides a link to documentation for Windows
  • helpUrl: provides a link to customer service for Windows
  • versionMajor: provides the version of the CLI to Windows
  • versionMinor: provides the version of the CLI to Windows
  • versionPatch: provides the version of the CLI to Windows
  • windows
    • certificateName: the name of the certificate file and auth item to fetch (for code signing)
    • installerAppName: provides the name of the CLI Windows installer program to Windows
    • installerFileName: the name of the Windows installer binary
    • uninstallerFileName: the name of the Windows uninstaller binary

Uninstall

  1. For Mac and Linux:
curl https://cdn.liferay.cloud/lcp/stable/latest/uninstall.sh -fsSL | bash
  1. For Windows:

Navigate to Control Panel -> Add or Remove Programs. Find "LCP CLI" in the list of programs, select it, and click "Uninstall". Follow the steps in the wizard.

License

BSD-3-Clause, © Liferay, Inc.