Skip to content

[Package Management] Improvements to `ligo publish`

Motivation and Context

The ligo publish command was lacking some features like

  • --dry-run flag
  • Support for .ligoignore
  • Tests were missing
  • Validations before publishing to registry, etc.

Address some of the TODOs from #1440

Description

This MR Adds the following features to ligo publish

  1. Adds Support --dry-run flag
  2. Adds Support for .ligoignore file (Support glob patterns of files & dirs to ignore/exclude)
  3. Adds Tests & Refactors code for Manifest parsing & Validations
  4. Sends additional stats about pacakge to registry like fileCount & unpackedSize
  5. Better CLI report for ligo publish
  6. Improves documentation
  7. Adds validations for main (checks if main file is present) & In case of contract checks initial storage
  8. Improve error message for ligo install in case of no package.json or invalid package.json

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (non-breaking change that improves performance)
  • None (change with no changelog)

Changelog

  • Adds Support --dry-run flag to ligo publish
  • Better CLI report for ligo publish
  • Add validation before publishing packages
  • Add support for .ligoignore file & Improve support for .ligorc file

change in CLI report:

$ ligo publish --ligorc-path ./.ligorc
==> Reading manifest... Done
==> Validating manifest file... Done
==> Finding project root... Done
==> Packing tarball... Done
    publishing: ligo-list-helpers@1.0.0
    === Tarball Details ===
    name:          ligo-list-helpers
    version:       1.0.0
    filename:      ligo-list-helpers-1.0.0.tgz
    package size:  895 B
    unpacked size: 1.1 kB
    shasum:        37737db2f58b572f560bd2c45b38e6d01277395d
    integrity:     sha512-a904c5af793e6[...]fc0efee74cfbb26
    total files:   6
==> Checking auth token... Done
==> Uploading package... Done
Package successfully published

Checklist:

  • Changes follow the existing coding style (use dune @fmt to check).
  • Tests for the changes have been added (for bug fixes / feature).
  • Documentation has been updated.
  • Changelog description has been added (if appropriate).
  • Start titles under ## Changelog section with #### (if appropriate).
  • There is no image or uploaded file in changelog
  • Examples in changed behaviour have been added to the changelog (for breaking change / feature).
Edited by Melwyn Saldanha

Merge request reports

Loading