open-index/open-npm huggingface dataset:
npm package: @pouch/caa-engine
Description: CAA engine
Author: Global Savings Group
Latest version: 2.0.2

# CAA engine

## Init project

- install [Node v16 LTS](https://nodejs.org)
- `npm install`
- `npx playwright install` - install browser engines for testing

## Development

Run next commands in separate terminal windows/tabs (use `Ctrl+C` to stop process):

- `npm run dev` - compile `src` directory to use with test server + automatically re-compile on changes
- `npm run test-server` - run local test server to debug pages

Check _test-server/README.md_ file for more information

## Tests

- `npm run tests:unit` - run all unit tests
- `npm run tests:e2e` - run all e2e tests (test server runs automatically)
- `npx playwright test e2e/adidas.e2e.ts` - run a single e2e test

Check _e2e/README.md_ file for more information about e2e tests

## Publishing new version to NPM

**Prerequisites:**

- create file `.npmrc` with publisher token (this file ignored by git)

**Publishing:**

- run `npm run build` to compile files;
- run `npm version patch|minor|major` to increment the version using semver
- run `npm publish --access public`
npm package: @pouch/create-gsg-extension
Description: Utility to bootstrap a GSG browser extension
Author: GSG
Latest version: 0.1.4

# Create gsg extension

This utility is one time use command to create a skeleton of a GSG browser extension.

The generated extension comes with support for Chrome, Firefox and Safari out of the box.
It also comes with it's own build system (for development and building) based on webpack with Typescript and Sass support.

## Utilization

The simplest way to use the utility is to invoke it with npx

```bash
npx @pouch/create-gsg-extension <directory>
```

Where `<directory>` is the (relative) directory where the new extension project will be created

## Building

To build the utility, either run the following command in the `core` folder

```bash
npm -w create-gsg-extension run build
```

or run `npm run build` from the `core/packages/create-gsg-extension` directory

## Publishing

See the [root documentation](core/README.md)
npm package: @pouch/extension-logs
Description: Browser Extension DataDog monitoring & logging service
Author: Global Savings Group
Latest version: 1.0.6

# Extension logs and monitoring service

Based on DataDog and required Megatron clientHash as session ID.

Documentation: https://docs.datadoghq.com/logs/error_tracking/browser_and_mobile?tab=browser

Automatically log console errors and unhandled errors on HTML pages after initialisation.

## Usage

Install package:
- `npm install @pouch/extension-logs --save-dev`

Import log service and init in project:
```typescript
import { ExtensionLogsService } from '@pouch/extension-logs';

const logsService = new ExtensionLogsService();

logsService.init({
  clientToken: '{DataDog client token}',
  env: 'local', // 'local' | 'production' | 'staging'
  origin: 'background', // 'background' | 'content' | 'popup' | 'page'
  service: '{brand}:extension',
  sessionId: '{Megatron clientHash}',
  version: chrome.runtime.getManifest().version,
});

const data: any = {'x': 'y'}; // additional log data 
logsService.debug('debug message', data);
```
npm package: @pouch/extension-megatron
Description: Megatron analytics library
Author: Global Savings Group
Latest version: 1.0.1

# Megatron analytics library

Requires next [permissions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions) in manifest.json:
- `alarms` - send keep-alive notifications
- `storage` - store customerHash and last keep-alive notification date

## Usage

Init Megatron singleton object anytime when all required params loaded/available:
```typescript
import { megatron } from '@pouch/extension-megatron'

await megatron.init({
  apiUrl: '{API URL}',
  customerHash: { customerHash }, // customerHash as string or undefined for auto-generation
  trackId: '{track ID}', // ask BI team for unique trackId
  trackUrlPrefix: 'https://website', // automatic URL prefix for "/page/urls"
  version: chrome.runtime.getManifest().version,
});
```

Track page view (can be called even before `.init()`):
```typescript
import { megatron } from '@pouch/extension-megatron'

// `trackUrlPrefix` will be added automatically before for all URLs started with "/"
await megatron.trackPageView({
  title: 'optional page title',
  url: '/page/url' 
});
```

Keep alive notifications:
```typescript
import { megatron } from '@pouch/extension-megatron'

// Recommended check interval is 5-10 minutes, Megatron will send it only once per 24h
chrome.alarms.create('megatron:ping', { periodInMinutes: 10 });

// add global onAlarm listener or add logic to the beginning of existing listener
chrome.alarms.onAlarm.addListener((alarm) => {
  if(alarm.name === 'megatron:ping'){
    megatron.init({...});
    megatron.ping();
    return;
  }
  
  // ... other event handlers
});
```
npm package: @pouchlab/auth
Description: Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
Latest version: 1.0.0

# create-svelte

Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).

Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npx sv create

# create a new project in my-app
npx sv create my-app
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.

## Building

To build your library:

```bash
npm run package
```

To create a production version of your showcase app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.

## Publishing

Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).

To publish your library to [npm](https://www.npmjs.com):

```bash
npm publish
```