Skip to content

Instantly share code, notes, and snippets.

@ochaloup
Created April 23, 2025 12:20
Show Gist options
  • Select an option

  • Save ochaloup/d98ba1eab351b6a3066daa825e92efc4 to your computer and use it in GitHub Desktop.

Select an option

Save ochaloup/d98ba1eab351b6a3066daa825e92efc4 to your computer and use it in GitHub Desktop.
PNPM publish

On how to test the CLI will work properly when released.

  • Checking what are files to be published

    pnpm publish --dry-run
  • Checking how the publish data looks like

    # clean the dist directory
    rm -rf dist/
    # build and generate dist/ directory that will be published
    pnpm build
    cd dist/
    # generated .tgz file that is uploaded to npm registry
    pnpm pack
  • Checking publish process and CLI installation

    • Check currently configured registry
      pnpm config get  registry
      > https://registry.npmjs.org/
    • Installing local registry
      # Run local registry
      pnpm install -g verdaccio
      # Remove all verdaccio data to start clean
      rm -rf ~/.config/verdaccio
      rm -rf ~/.local/share/verdaccio/
      pnpm cache clean '@marinade.finance'
      
      verdaccio
      # Configure npm/pnpm to use the local registry
      pnpm config set registry http://localhost:4873/
      # needed to authenticate (password has to be like Test123!)
      npm adduser --registry http://localhost:4873/ 
    • Publish and check CLI
      cd <root>
      pnpm publish:all
      pnpm install -g @marinade.finance/validator-bonds-cli
      validator-bonds --version
  • Configure the registry back

    pnpm config set registry https://registry.npmjs.org/
    pnpm config get registry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment