open-index/open-npm huggingface dataset:
npm package: @haus-automation/iobroker-adapter-tools
Description: Helper functions for ioBroker adapter development
Author: Matthias Kleine
Latest version: 0.0.2

# ioBroker adapter-tools



## Changelog
<!--
    Placeholder for the next version (at the beginning of the line):
    ### **WORK IN PROGRESS**
-->
### 0.0.2 (2023-06-07)

* (klein0r) Updated release-script

### 0.0.1 (2023-06-07)

* (klein0r) Added base class for ioBroker adapter development

## License
MIT License

Copyright (c) 2023 Matthias Kleine <info@haus-automatisierung.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
npm package: @haus-tech/product-popularity-plugin
Description: Product popularity plugin for Vendure
Author: Haus Tech
Latest version: 3.0.5

---
name: product-popularity-plugin
title: Product Popularity Plugin
description: Vendure plugin designed to expose and query product popularity metrics in your e-commerce store.
version: 3.0.0
---

# Product Popularity Plugin

The Product Popularity Plugin is a Vendure plugin designed to expose and query the popularity of products in your e-commerce store. It provides a mechanism to store and retrieve a static popularity metric for products, enabling better decision-making for inventory management, marketing, and promotions.

## Functionality

This plugin enables the following features:

- Storing a static popularity metric (`popularityInternal`) in the database.
- Exposing the popularity metric via the Shop GraphQL API.
- Integrating with ElasticSearch to enable sorting search results by product popularity.

## Use Cases

The Product Popularity Plugin is ideal for:

- Displaying a predefined popularity metric for products.
- Sorting search results based on product popularity.
- Supporting marketing campaigns for popular products.

## Installation

1. Clone the repository or copy the `product-popularity-plugin` directory into your project.
2. Navigate to the plugin directory:

   ```bash
   cd packages/product-popularity-plugin
   ```

3. Install the dependencies:

   ```bash
   yarn
   ```

4. Build the plugin:

   ```bash
   yarn build
   ```

5. Add the plugin to your Vendure configuration:

   ```typescript
   import { ProductPopularityPlugin } from 'product-popularity-plugin'

   export const config = {
     plugins: [
       ProductPopularityPlugin,
       // other plugins
     ],
   }
   ```

## Usage

1. Start the Vendure server:

   ```bash
   yarn start
   ```

2. Access the admin UI at `http://localhost:3050/admin` and log in with the default credentials (_superadmin/superadmin_).
3. Use the shop GraphQL API at `http://localhost:3050/shop-api` to query product popularity data.

## Testing

1. Run the end-to-end tests:

   ```bash
   yarn test
   ```

2. Modify the tests in `test/e2e.spec.ts` to suit your plugin's functionality.

## Publishing to NPM

1. Ensure you are [logged in to NPM](https://docs.npmjs.com/cli/v9/commands/npm-login).
2. Build the plugin:

   ```bash
   yarn build
   ```

3. Publish the plugin:

   ```bash
   yarn publish
   ```

## Resources

- [Vendure Plugin Documentation](https://www.vendure.io/docs/plugins/)
- [GraphQL Code Generator](https://the-guild.dev/graphql/codegen) for generating TypeScript types for custom GraphQL types.