@u2dv/marketplace_common
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

Marketplace Common

A library of reusable code for use in Uptodate Marketplace projects.

About this package

The Marketplace common package was created in May 2021 with the goal of improving code reuse and reducing code duplication in Marketplace projects. It is supposed to contain all classes, functions and constants which are used in more than one project. Instead of copying and pasting the same code from one repository to another, it is preferred that the shared code is put into this package.

What code should I put in here?

  • Everything that is used in more than one place. Put it in here instead of copying and pasting (duplicating) code.
  • Do not put code in here because you think it might be generally useful. If it is used in only one place, just put it there directly.
  • Do not put UI components or assets (styles, fonts, images etc.) here.

Publishing a new version

If you want to publish a new version of the package to the private NPM registry, you can follow these steps:

  1. Bump the package version by increasing the "version" property npm version major|minor|patch.

  2. Perform a test run of the publish to see what would happen:

    $ npm publish --dry-run

    Most importantly, this will show you the contents of the package as they would be published.

  3. Finally, once you have verified the package, publish it as follows:

    $ npm publish --access public

Note: be sure to only publish from the latest revision of the master branch. If you need to publish a pre-release for testing purposes, use the --tag argument to npm publish as described here: npm-prerelease.

Tip: trying out a new version before publishing

You can use the npm pack command to store the NPM package on your local disk:

$ cd marketplace_common
$ npm pack

Assuming that your marketplace_common directory is in /home/user/marketplace_common and the current version of the package is 1.0.4, npm pack will generate the following file:

/home/user/marketplace_common/u2dv-marketplace_common-1.0.4.tgz

You can now install this package into another project using npm as follows:

$ npm install /home/user/marketplace_common/u2dv-marketplace_common-1.0.4.tgz

Installing the package this way is 100% identical to installing the package from the package registry via the Internet. It can be a good way to verify that the package works as expected before publishing it.

Versioning considerations

Before you publish a new release, follow the semantic versioning guidelines in order to choose a new version number. Most importantly, use a major version bump (1.x => 2.x) if you need to publish a breaking change.

Contributing

First, install the dependencies:

$ npm install

You can now run the tests:

$ npm test

Readme

Keywords

none

Package Sidebar

Install

npm i @u2dv/marketplace_common

Weekly Downloads

1

Version

1.1.4

License

UNLICENSED

Unpacked Size

53.4 kB

Total Files

42

Last publish

Collaborators

  • u2dv-infra
  • atombrenner
  • christian-uptodate