open-index/open-npm huggingface dataset:
npm package: @phygrid/barcode-scanner-react
Description: ## Installation
Latest version: 0.1.18

# React custom hook for barcode scanner integration.

## Installation

```
npm install @ombori/ga-barcode-scanner --save
```

or

```
yarn add @ombori/ga-barcode-scanner
```

## Usage

```jsx
import useBarcodeScanner from '@ombori/ga-barcode-scanner';

const App = () => {
  const onScan = (barcode) => console.log(barcode);

  useBarcodeScanner(onScan);
  
  return <div>Hello World!</div>;
}
```

## Helpers

There are also two helper functions that you can use to differentiate barcodes and boarding passes.

```jsx
import { isBarcode, isBoardingPass } from '@ombori/ga-barcode-scanner';
```
npm package: @phygrid/edge-messaging
Description: A module performing device-to-module communications for gridapps
Latest version: 4.0.1

## Phygrid Edge Messaging

A module performing device-to-module communications for gridapps

### Hooks

#### `usePublish()`

Returns a `(type: string, payload: any) => void` function, that could be used to broadcast messages to modules.

Example:
```
import {usePublish} from '@phygrid/edge-messaging';

export default App = () => {
  const publish = usePublish();

  const handleClick = useCallback(() => {
    publish('Test.ping', {hello: 'world'});
  }, [publish])

  return <button onClick={handleClick}>pub</button>
}
```

#### `useSubscribe(type: string, callback: (msg: any) => void, deps: any[]);`

Subscribes to a certain message type.

#### `useStatus(): boolean`

Returns message bus connection status

#### `useHeartbeat(): void`

Sends heartbeats to GridOS, indicating that app is alive.
npm package: @phylaxpl/gatsby-plugin-trustpilot-widget
Description: Trustpilot widget for GatsbyJS.
Author: Lukasz Nowicki
Latest version: 2.0.3
Deprecated: false

# phylax/gatsby-plugin-trustpilot-widget

Forked from https://github.com/pittica/gatsby-plugin-trustpilot-widget

## Description

[Trustpilot](https://www.trustpilot.com/) widget for [GatsbyJS](https://www.gatsbyjs.org/).

## Install

[![npm](https://img.shields.io/npm/v/@phylaxpl/gatsby-plugin-trustpilot-widget)](https://www.npmjs.com/package/@phylaxpl/gatsby-plugin-trustpilot-widget)

```shell
npm install @phylaxpl/gatsby-plugin-trustpilot-widget
```

## Configuration

Edit your **gatsby-config.js**.

```javascript
module.exports = {
  plugins: [
    {
      resolve: `@phylaxpl/gatsby-plugin-trustpilot-widget`,
      options: {
        username: "USERNAME",
        business: "BUSINESS_ID",
      }
    },
  ],
}
```

The _username_ and _template_ fields **are required**.

You can get the data from the TrustBox in your businness panel on [Trustpilot](https://www.trustpilot.com/)

```HTML
<!-- TrustBox widget - Review Collector -->
<div class="trustpilot-widget" data-locale="en-US" data-template-id="TEMPLATE_ID" data-businessunit-id="BUSINESSUNIT_ID" data-style-height="52px" data-style-width="100%">
  <a href="https://en.trustpilot.com/review/USERNAME" target="_blank" rel="noopener">Trustpilot</a>
</div>
<!-- End TrustBox widget -->
```

## Component Usage

Import the component **TrustpilotReviews** in your component.

```javascript
import TrustpilotReviews from "@phylaxpl/gatsby-plugin-trustpilot-widget"
```

Use it in your code as component.

```javascript
class MyComponent extends React.Component {
  render() {
    return (
      <TrustpilotReviews
        template="TEMPLATE_ID"
        language="en"
        culture="US"
        theme="light"
        width="100%"
        height="52px"
      />
    )
  }
}
```

### Attributes

**template** attribute is obligatory. The component has optional attributes which the user can use to set the aspect of the TrustBox.

#### language

Sets the language of the locale and the language of the API.

##### Default Value
`en`

##### Note
If you set the language attribute you have to set the _culture_ attribute too.

#### culture

Sets the culture of the locale.

##### Default Value
`US`

##### Note
If you set the culture attribute you have to set the _language_ attribute too.

#### theme

Sets the UI theme of the TrustBox.

##### Values
* `light`
* `dark`

##### Default value
`light`

#### width

Sets the width of the widget.

##### Default Value
`100%`

#### height

Sets the height of the widget.

##### Default Value
`52px`

## Copyright

(c)2021, phylax.pl Lukasz Nowicki
npm package: @phylum/cli
Description: Phylum cli
Author: Max J. Polster
Latest version: 4.3.0

# Pipeline Cli

## Usage
```bash
npm i @phylum/cli @phylum/pipeline

# Optional global installation:
npm i -g @phylum/cli
```

```bash
# Basic usage:
phylum [[--run] <modulePath>]
```
+ `--run` - Specify the entry module that exports the task to run. Default is `./pipeline`

## Entry module
The entry module must be a commonjs module that exports a task instance as default:
```ts
const { Task } = require('@phylum/pipeline');

export.default = new Task(async () => {
	console.log('Hello World!');
});
```

## Arguments
The entry module can also export an array of [argument specs](https://github.com/phylumjs/command) for parsing custom command line arguments:
```ts
const { config } = require('@phylum/cli');

exports.default = new Task<void>(async t => {
	// Access parsed arguments:
	const {command} = await t.use(config);
	console.log(command.message);
});

exports.args = [
	{name: 'message', alias: 'm', defaultValue: 'Hello World!'}
];
```
```bash
phylum
# => Hello World!

phylum --message "Foo!"
# => Foo!
```
npm package: @phylum/command
Description: Configurable command line parser
Author: Max J. Polster
Latest version: 1.2.0

# @phylum/command
[![Build Status](https://travis-ci.com/phylumjs/command.svg?branch=master)](https://travis-ci.com/phylumjs/command)
[![Coverage Status](https://coveralls.io/repos/github/phylumjs/command/badge.svg?branch=master)](https://coveralls.io/github/phylumjs/command?branch=master)
[![Latest](https://img.shields.io/npm/v/@phylum/command.svg) ![License](https://img.shields.io/npm/l/@phylum/command.svg)](https://npmjs.org/package/@phylum/command)

Configurable command line parser

<br>



# Usage
```bash
npm i @phylum/command
```

```ts
import { CommandSpec } from '@phylum/command';

new CommandSpec()
	.add({name: 'foo', multiple: true})
	.add({name: 'bar', alias: 'b' type: 'flag'})
	.parse(['--foo', 'bar', 'baz', '-b']);

// => { foo: ['bar', 'baz'], bar: true }
```

## Command Line Format
| Format | Output | Spec |
|-|-|-|
| `"--foo bar"` | `{foo: 'bar'}` | `{name: 'foo'}` |
| `"--foo=bar"` | `{foo: 'bar'}` | `{name: 'foo'}` |
| `"--foo bar baz"` | `{foo: ['bar', 'baz']}` | `{name: 'foo', multiple: true}` |
| `"bar baz"` | `{foo: ['bar', 'baz']}` | `{name: 'foo', multiple: true, defaultFallback: true}` |
| `"--foo"` | `{foo: true}` | `{name: 'foo', type: 'flag'}` |
| `"--foo 42"` | `{foo: 42}` | `{name: 'foo', type: 'number'}`
| `"-f bar"` | `{foo: 'bar'}` | `{name: 'foo', alias: 'f'}` |
| `"-fb"` | `{foo: true, bar: true}` | `{name: 'foo', alias: 'f', type: 'flag'}, {name: 'bar', alias: 'b', type: 'flag'}` |
| `""` | `{foo: 'bar'}` | `{name: 'foo', defaultValue: 'bar'}` |
| `-- bar --baz` | `{foo: ['bar', '--baz']}` | `{name: 'foo', type: 'rest'}` |

## Options

### `options.partial`
If specified, unknown arguments will be ignored instead of throwing an error.
```ts
new CommandSpec()
	.add({name: 'foo'})
	.parse(['--foo', 'bar', '--baz'], {partial: true});

// => { foo: 'bar' }
```

### `options.sparse`
If specified, arguments that follow others may be associated with the default argument.

```ts
new CommandSpec()
	.add({name: 'foo', default: true})
	.add({name: 'bar'})
	.parse(['--bar', 'baz', 'foo'], {sparse: true});

// => { bar: 'baz', foo: 'foo' }
```

## Custom Types
```ts
function myType(value: string, spec: ArgumentSpec, options: ArgumentOptions) {
	return value.toUpperCase();
}

new CommandSpec()
	.add({name: 'foo', type: myType})
	.parse(['--foo', 'bar']);

// => { foo: 'BAR' }
```

<br>



## Packaged Code
| Path | Type | Entry Point |
|-|-|-|
| `/dist/node` | ES2017, CommonJS Modules | `main` |
| `/dist/es2015` | ES2015, ES Modules | `browser` |
| `/dist/es2017` | ES2017, ES Modules | |
| `/src` | TypeScript Sources | |
npm package: @phylum/gulp-pipeline
Description: Create a gulp task that runs a pipeline or pipeline task.
Author: Max J. Polster
Latest version: 3.0.0

# Gulp Pipeline
[![Coverage Status](https://coveralls.io/repos/github/phylumjs/gulp-pipeline/badge.svg?branch=master)](https://coveralls.io/github/phylumjs/gulp-pipeline?branch=master)
[![Build Status](https://travis-ci.com/phylumjs/gulp-pipeline.svg?branch=master)](https://travis-ci.com/phylumjs/gulp-pipeline)
[![Version](https://img.shields.io/npm/v/@phylum/gulp-pipeline.svg) ![License](https://img.shields.io/npm/l/@phylum/gulp-pipeline.svg)](https://npmjs.org/package/@phylum/gulp-pipeline)

Create a gulp task that runs a pipeline or pipeline task.

## Installation
```js
npm i @phylum/gulp-pipeline gulp
```

## Usage
```js
const gulp = require('gulp')
const wrap = require('@phylum/gulp-pipeline')
```

### `wrap(pipelineOrTask[, options])`
Create a gulp task from an existing pipeline or pipeline task.
```js
const gulpTask = wrap(async ctx => {
    console.log('Hello World!')
}, {
    name: 'example-task',
    description: 'Just another code example..'
})

// Usage example:
gulp.task(gulpTask)
```
+ pipelineOrTask `<Pipeline> | <function>` - A pipeline or a pipeline task.
+ options `<object>` - Optional. An object with the following options:
    + name `<string>` - Optional gulp task name. Default is `'pipeline'`
    + description `<string>` - Optional gulp task description.
    + flags `<object>` - Optional gulp task flags.
    + run `<string> | <function>` - Optional. The action to run the pipeline:
        + `'once'` - **Default.** Ensure that the pipeline is enabled. The task will complete when the pipeline resolves or rejects.
        + `'clean'` - Disable the pipeline, then enable. The task will complete when the pipeline resolves or rejects.
        + `<function>` - A function that is called with the pipeline as first argument and must return a promise to signal async completion.
    + autoDisposeUnused `<boolean>` - Optional. This option is passed to the pipeline constructor when a pipeline task is wrapped.
npm package: @phylum/gulp-task
Description: Gulp task integration
Author: Max J. Polster
Latest version: 3.0.1
Deprecated: No longer supported.

# Gulp Task
[![Coverage Status](https://coveralls.io/repos/github/phylumjs/gulp-task/badge.svg?branch=master)](https://coveralls.io/github/phylumjs/gulp-task?branch=master)
[![Build Status](https://travis-ci.com/phylumjs/gulp-task.svg?branch=master)](https://travis-ci.com/phylumjs/gulp-task)
[![Version](https://img.shields.io/npm/v/@phylum/gulp-task.svg) ![License](https://img.shields.io/npm/l/@phylum/gulp-task.svg)](https://npmjs.org/package/@phylum/gulp-task)

Allows embedding gulp tasks as pipeline tasks.

## Installation
```bash
npm i @phylum/gulp-task gulp
```

## Usage
This package exposes a function for wrapping a gulp task into a pipeline task.<br>
```js
const wrap = require('@phylum/gulp-task')

const task = wrap(fn[, options])

async function example(ctx) {
	await ctx.use(task)
}
```
+ fn `<function> | <string>` - The gulp task function or the name of a registered gulp task.
+ options `<object>` - Optional. An object with options explained below.
+ returns `<function>` - The pipeline task.

### `options.context`
The task context can be accessed from within the gulp task using the `context` option.
```js
const task = wrap((done, ctx) => {
	// Gulp task code...
}, {context: true})
```
npm package: @phylum/pipeline
Description: Flexible Async JavaScript Task Runner
Author: Max J. Polster
Latest version: 4.2.0

# @phylum/pipeline
[![Build Status](https://travis-ci.org/phylumjs/pipeline.svg?branch=master)](https://travis-ci.org/phylumjs/pipeline)
[![Coverage Status](https://coveralls.io/repos/github/phylumjs/pipeline/badge.svg?branch=master)](https://coveralls.io/github/phylumjs/pipeline?branch=master)
[![Latest](https://img.shields.io/npm/v/@phylum/pipeline.svg?label=latest) ![License](https://img.shields.io/npm/l/@phylum/pipeline.svg?label=license)](https://npmjs.org/package/@phylum/pipeline)

### [Documentation](https://phylum.js.org/)

## Packaged Includes
| Path | Type | Entry Point |
|-|-|-|
| `/dist/node` | ES2017, CommonJS Modules | `main` |
| `/dist/es` | ES6 | `browser` |
| `/src` | TypeScript Sources | |
npm package: @phylum/rxjs
Description: RxJS Integration
Author: Max J. Polster
Latest version: 1.0.0

# @phylum/rxjs
RxJS Integration

## Installation
```bash
npm i @phylum/pipeline @phylum/rxjs rxjs
```

## Creating observables
Pipeline tasks can be wrapped into observables that push objects with an `error` or with a `value` property representing the task result.
```ts
import { createObservable } from '@phylum/rxjs';

const task = new Task(async () => {
	return 'Hello World!';
})

const observable = createObservable(task);

observable.subscribe(({ value, error }) => {
	if (error) {
		console.error(error);
	} else {
		console.log(value);
	}
});
```

## Creating tasks
Observables can be wrapped into tasks that emit results for each value or error that is pushed by the observable.
```ts
import { createTask } from '@phylum/rxjs';

const observable = new Observable(subscriber => {
	subscriber.next('Hello World!');
})

const task = createTask(observable);

new Task(async t => {
	console.log(await t.use(task));
})
```
npm package: @phylum/webpack
Description: Webpack integration
Author: Max J. Polster
Latest version: 4.0.3

# PhlumJS + Webpack
[![Build Status](https://travis-ci.com/phylumjs/webpack.svg?branch=master)](https://travis-ci.com/phylumjs/webpack)
[![Coverage Status](https://coveralls.io/repos/github/phylumjs/webpack/badge.svg?branch=master)](https://coveralls.io/github/phylumjs/webpack?branch=master)
[![Latest](https://img.shields.io/npm/v/@phylum/webpack.svg?label=latest) ![License](https://img.shields.io/npm/l/@phylum/webpack.svg?label=license)](https://npmjs.org/package/@phylum/webpack)

## Installation
```bash
npm i @phylum/webpack webpack
```

<br>

# Usage
```ts
import { Task } from '@phylum/pipeline';
import { WebpackTask } from '@phylum/webpack';

const config = Task.value({
	// ...webpack config...
});

const bundle = new WebpackTask(config);
```

## Output
The task will output stats from the latest compilation<br>
and will only reject in case of critical errors.
```ts
new Task(async t => {
	const stats = await t.use(bundle);
	const data = stats.toJson();
	for (const msg of data.warnings) {
		console.warn(msg);
	}
	for (const msg of data.errors) {
		console.error(msg);
	}
});
```
npm package: @phylum/webpack-node
Description: Run a node process from a webpack bundle
Author: Max J. Polster
Latest version: 1.0.0-beta.3


# Webpack Node Task
[![Build Status](https://travis-ci.com/phylumjs/webpack-node.svg?branch=master)](https://travis-ci.com/phylumjs/webpack-node)
[![Coverage Status](https://coveralls.io/repos/github/phylumjs/webpack-node/badge.svg?branch=master)](https://coveralls.io/github/phylumjs/webpack-node?branch=master)
[![Latest](https://img.shields.io/npm/v/@phylum/webpack-node.svg?label=latest) ![License](https://img.shields.io/npm/l/@phylum/webpack-node.svg?label=license)](https://npmjs.org/package/@phylum/webpack-node)

This package exposes a task that runs a node process for webpack bundled code and supports hot module replacement.

## Installation
```bash
npm i webpack @phylum/webpack @phylum/webpack-node
```

# Usage
The webpack node task runs a node process from bundled sources.
*Note, that the webpack task will not be started automatically by the webpack node task.*

```ts
import { Task } from '@phylum/pipeline';
import { WebpackTask } from '@phylum/webpack';
import { WebpackNodeTask } from '@phylum/webpack-node';

const bundle = new WebpackTask(...);

const node = new WebpackNodeTask(Task.value({
	main: bundle
}));

new Task(async t => {
	// Run the webpack compiler:
	await t.use(bundle);
	// Start a node process:
	await t.use(node);
});
```
*Note that the node task assumes, that the main bundle has already been compiled.*

## Hot Module Replacement
```ts
new WebpackNodeTask(Task.value({
	// Enable hot module replacement:
	mainHmr: true,
	main: bundle
}));
```
```ts
// Import the hmr client somewhere in your main process code...
import '@phylum/webpack-node/dist/hmr';
```
```ts
// ...or add it to your entry point:
entry: ['@phylum/webpack-node/dist/hmr', './src/main.js'],

// Optional. Include the hmr runtime:
plugins: [
	new webpack.HotModuleReplacementPlugin()
]
```
If the hmr runtime is not included or an update is rejected, the main process will be rebooted.
npm package: @phylum/webpack-server
Description: Webpack server task
Author: Max J. Polster
Latest version: 1.0.3

# Webpack Server Task
[![Build Status](https://travis-ci.com/phylumjs/webpack-server.svg?branch=master)](https://travis-ci.com/phylumjs/webpack-server)
[![Coverage Status](https://coveralls.io/repos/github/phylumjs/webpack-server/badge.svg?branch=master)](https://coveralls.io/github/phylumjs/webpack-server?branch=master)
[![Latest](https://img.shields.io/npm/v/@phylum/webpack-server.svg?label=latest) ![License](https://img.shields.io/npm/l/@phylum/webpack-server.svg?label=license)](https://npmjs.org/package/@phylum/webpack-server)

## Installation
```bash
npm i webpack @phylum/webpack @phylum/webpack-server
```

## Usage
The webpack server task runs an [express](https://expressjs.com/) application that serves the webpack output directory.<br>
*Note, that the webpack task will not be started automatically by the webpack server task.*

```ts
import { Task } from '@phylum/pipeline';
import { WebpackTask } from '@phylum/webpack';
import { WebpackServerTask } from '@phylum/webpack-server';

const bundle = new WebpackTask(...);

const serveBundle = new WebpackServerTask(webpackTask);

new Task(async t => {
	// Run the webpack compiler:
	await t.use(bundle);
	// Serve bundled files:
	await t.use(serveBundle);
});
```

## Listening
By default, the server will listen on `localhost:8080`.
```ts
new WebpackServerTask(webpackTask, Task.value({
	listen: 8080
}));
```
You can specify any argument that can be passed to `net/server.listen(..)`

## History fallback
For single page applications, it is common to fallback to `/index.html` if a request path is not found:
```bash
npm i connect-history-api-fallback
```
```ts
import history = require('connect-history-api-fallback');

new WebpackServerTask(webpackTask, Task.value({
	setup({ app }) {
		app.use(history());
	}
}));
```

## Client Updates
When the webpack task completes, an update message is broadcasted to all connected clients via web socket:
```ts
{
	"name": "webpack-update",
	// In case of an error:
	"error": "<details>"
	// else:
	"stats": {
		"errors": [...],
		"warnings": [...]
	}
}
```

## Hot module replacement
The hot module replacement client that ships with this package connects to the included web socket server and applies updates or reloads the page if not possible.
```ts
// Import the hmr client somewhere in your code...
import '@phylum/webpack-server/dist/hmr';
```
```ts
// ...or add it to your entry point:
entry: ['@phylum/webpack-server/dist/hmr', './src/index.js'],

// Optional. If not included, the hmr client
// will fallback to just reloading the web page.
plugins: [
	new webpack.HotModuleReplacementPlugin()
]
```
npm package: @phylum/webpack-task
Description: Webpack pipeline task
Author: Max J. Polster
Latest version: 3.0.0
Deprecated: No longer supported.

# Webpack Task
[![Coverage Status](https://coveralls.io/repos/github/phylumjs/webpack-task/badge.svg?branch=master)](https://coveralls.io/github/phylumjs/webpack-task?branch=master)
[![Build Status](https://travis-ci.org/phylumjs/webpack-task.svg?branch=master)](https://travis-ci.org/phylumjs/webpack-task)
![Version](https://img.shields.io/npm/v/@phylum/webpack-task.svg)
![License](https://img.shields.io/npm/l/@phylum/webpack-task.svg)

A pipeline task that bundles code using webpack.

## Installation
```bash
npm i @phylum/webpack-task webpack
```
*Supported webpack versions range from 3.11.0 to 4.x.x*

## Usage
```js
const createWebpackTask = require('@phylum/webpack-task')

// Create a new pipeline task:
const webpackTask = createWebpackTask(config[, webpack])
```
+ config `<webpack.Compiler> | <object> | <function>` - This can be a webpack compiler, a webpack config or a function that creates one of these.
	+ ctx `<Context>` - The pipeline context of the webpack task is passed with the first argument.
	+ return `<webpack.Compiler> | <object> | <Promise>` - Return a webpack compiler, config or a promise that resolves to one of these.
+ webpack `<webpack>` - Optional. Specify a specific webpack module to use instead of the default installed one.

### Integration
The webpack task can be used like a pipeline task.<br/>
It will resolve to the webpack stats emitted by the compiler. In case of a critical compiler error, the task will reject with that error.
```js
const webpackTask = createWebpackTask({
	// Webpack config...
})

async function myTask(ctx) {
	const stats = await ctx.use(webpackTask)
}
```

### Passing custom options
To customize the webpack configuration based on pipeline data, pass a function with the config argument:
```js
// For instance, set the mode:
const webpackTask = createWebpackTask(async ctx => {
	return {
		mode: ctx.pipeline.data.mode,
		watch: ctx.pipeline.data.watch
		// webpack config...
	}
})

const pipeline = new Pipeline(webpackTask)
pipeline.data.mode = 'development'
pipeline.data.watch = true
```

### Watch mode
To enable watch mode use [webpack's watch options](https://webpack.js.org/configuration/watch/). Each time, an updates is emitted, the task will push a new state.
npm package: @phylum/worker-task
Description: Move tasks that are computationally heavy or use synchronous io to a worker thread
Author: Max J. Polster
Latest version: 3.0.0-beta.0

# worker-task
Move tasks that are computationally heavy or use synchronous io to [a worker thread](https://nodejs.org/dist/latest/docs/api/worker_threads.html).<br>

## Installation
```bash
npm i @phylum/worker-task
```
**Please note that node worker threads are currently experimental!**
```bash
# In order to enable worker thread support, you
# have to pass the following flag to node:
node --experimental-worker ...
```

<br>



# Usage
When a worker task is executed, it will create a new worker thread, load the specified entry module and run the exported task in an independent pipeline.

### `createWorkerTask(filename[, options])`
```js
// parent.js
const {createWorkerTask} = require('@phylum/worker-task')

const task = createWorkerTask(path.join(__dirname, 'worker'))
```
```js
// worker.js
module.exports = async ctx => {
	console.log('Hello World!')
}
```
+ filename `<string>` - The filename of the worker entry. This can be relative to the current working directory.
+ options `<object>` - An object with the following options:
	+ stdin, stdout, stderr, execArgv - See [worker options](https://nodejs.org/dist/latest/docs/api/worker_threads.html#worker_threads_new_worker_filename_options)
	+ onDispose - Set how to dispose the worker:
		+ `'disable'` - **Default.** Disable the worker pipeline.
		+ `'terminate'` - Terminate the worker thread. **(Not recommended)**

## Serialization
By default, errors are converted to strings using `util.inspect(..)` before passing them to the parent thread and results are not passed at all. You can use the [v8 serialization api](https://nodejs.org/dist/latest/docs/api/v8.html#v8_serialization_api) by wrapping a value into a `Serializable` instance. However if the wrapped value is not serializable, an error will be passed to the parent thread.
```js
// worker.js
const {Serializable, raw} = require('@phylum/worker-task')

module.exports = async ctx => {
	return new Serializable({foo: 'bar'})

	// Or use the shorthand function:
	return raw({foo: 'bar'})
}
```
npm package: @phyng/monaco-vue
Description: Monaco vue components
Latest version: 0.0.3


# monaco-vue

Monaco vue components

## install

```bash
npm install @phyng/monaco-vue
```

or

```bash
yarn add @phyng/monaco-vue
```

## example

```vue
<template>
  <MonacoRender v-model="value" class="a-editor-container"></MonacoRender>
</template>

<script>
import MonacoRender from '@phyng/monaco-vue/src/monaco-render.vue'

export default {
  components: {
    MonacoRender
  },
  data () {
    return {
      value: ''
    }
  }
}
</script>

<style lang="scss" scoped>
.a-editor-container {
  height: calc(100vh - 60px);
}
</style>
```

## options

```js
<MonacoRender
  v-model="value"
  :configType="'javascript'" // set language
  :sourceUrl="'test.js'"  // use sourceUrl to keep state
  :editorOptions="{}"
  :modelOptions="{}"
></MonacoRender>
```
npm package: @phyng/typeschema
Description: A database schema definition library using TypeScript or JSON
Author: phyng
Latest version: 0.0.2

# TypeSchema

A database schema definition library using TypeScript or JSON

[![npm](https://img.shields.io/npm/v/@phyng/typeschema)](https://www.npmjs.com/package/@phyng/typeschema)
[![docs](https://img.shields.io/badge/docs-phyng.com-blue)](https://phyng.com/typeschema/)

## install

```bash
# use pnpm
pnpm add @phyng/typeschema

# or use npm
npm install @phyng/typeschema
```

## Usage

```ts
import { Db, Table, Field } from '@phyng/typeschema'

const db = Db([
  Table('user', [
    Field('id', 'int', { pk: true, increment: true }),
    Field('username', 'string'),
    Field('name', 'string', { null: true }),
  ]),
  Table('post', [
    Field('id', 'int', { pk: true, increment: true }),
    Field('name', 'string'),
    Field('content', 'string'),
  ]),
])

export default db
```

## License

This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
npm package: @phyng/utils
Description: @phyng utils
Author: phyng
Latest version: 0.0.4

# @phyng/utils

@phyng/utils is a collection of utility functions for TypeScript and JavaScript.

[![npm](https://img.shields.io/npm/v/@phyng/utils)](https://www.npmjs.com/package/@phyng/utils)
[![docs](https://img.shields.io/badge/docs-phyng.com-blue)](https://phyng.com/utils/)

## install

```bash
# use pnpm
pnpm add @phyng/utils

# or use npm
npm install @phyng/utils
```

## Usage

```ts
import { uuidv4 } from '@phyng/utils'

console.log(uuidv4())
```

## License

This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.

## Acknowledgements

- [@antfu/utils](https://github.com/antfu/utils)
- [vitest](https://vitest.dev/)
npm package: @phyolim/react-rbac
Description: role based access control hook
Author: phyolim
Latest version: 1.1.0

# react-rbac

> role based access control for react apps

[![NPM](https://img.shields.io/npm/v/@phyolim/react-rbac.svg)](https://www.npmjs.com/package/@phyolim/react-rbac) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## [Demo](https://www.phyolim.dev/react-rbac)

https://www.phyolim.dev/react-rbac

## Install

```bash
npm install --save @phyolim/react-rbac
```

## Usage

Define permissions config in context provider.

```tsx
const App = () => {
  const permissions = {
    regularSettings: {
      user: ['r', 'u'],
      admin: ['r', 'u'],
    },
    advancedSettings: { user: ['r'], admin: ['u', 'r'] },
  };

  return (
    <RbacProvider permissions={permissions}>
      <ExampleRbacComponent />
    </RbacProvider>
  );
};
```

At the component level, you can use `useRbac` hook to get permissions.

```tsx
export const ExampleRbacComponent = () => {
  const options = {
    undefined: <div>You have no access</div>,
    null: <div>You have no access</div>,
    [['r'].toString()]: <div>You have read only access</div>,
    [['r', 'u'].toString()]: <div>You have read and write access</div>,
  };
  const access = useRbac('admin', 'advancedSettings');

  return options[access.sort()];
};
```

Example from demo page:

````tsx
export default function ReactRbacContainer() {
  const permissions = {
    'accounts-management': {
      'Regular User': ['r'],
      'Account Manager': ['r', 'u'],
      'Administrator': ['c', 'r', 'u', 'd'],
    },
  };
  return (
    <RbacProvider permissions={permissions}>
      <RbacDemo />
    </RbacProvider>
  );
}

const RbacComponent = () => {
  const access = useRbac('admin', "accounts-management");

  return (
    <>
      {access.includes("c") && <button type="button">Create</button>}
      <table>
        <thead>
        <tr>
          <th scope="col">Company Name</th>
          <th scope="col">
            <span className="sr-only">Edit</span>
          </th>
        </tr>
        </thead>
        <tbody>
        {companies.map((company) => (
          <tr key={company.name}>
            <td>{company.name}</td>
            <td>
              {access.includes("r") && <a href="#">View</a>}
              {access.includes("u") && <a href="#">Edit</a>}
              {access.includes("d") && <a href="#">Delete</a>}
            </td>
          </tr>
        ))}
        </tbody>
      </table>
    </>
  );
};

```

## License

MIT © [phyolim](https://github.com/phyolim)
````
npm package: @physis/react-server-dom-esm
Description: React Server Components bindings for DOM using ESM. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.
Latest version: 19.0.0-rc-cc0e491-20240519
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# react-server-dom-esm

Experimental React Flight bindings for DOM using ESM.

**Use it at your own risk.**
npm package: @phyxiusjs/temporal
Description: Temporal utilities for controlling function execution timing
Latest version: 0.1.1

# @phyxiusjs/temporal

Temporal utilities for controlling function execution timing.

These utilities help manage when and how often functions execute, using Clock for deterministic, testable time operations.

## Installation

```bash
npm install @phyxiusjs/temporal @phyxiusjs/clock
```

## What This Does

- **debounce**: Execute function after delay with no new calls
- **throttle**: Execute function at most once per interval
- Uses Clock abstraction instead of setTimeout for testable timing

## Quick Example

```typescript
import { debounce, throttle } from "@phyxiusjs/temporal";
import { createSystemClock } from "@phyxiusjs/clock";

const clock = createSystemClock();

// Debounce: Execute after delay with no new calls
const saveDocument = debounce(
  (doc: Document) => {
    console.log("Saving:", doc.id);
  },
  1000, // ms
  clock,
);

// Call many times, executes once after 1 second
saveDocument(doc);
saveDocument(doc);
saveDocument(doc); // Only this one executes

// Throttle: Execute at most once per interval
const updatePosition = throttle(
  (x: number, y: number) => {
    console.log(`Position: ${x}, ${y}`);
  },
  100, // ms
  clock,
);

// Call many times, executes every 100ms
for (let i = 0; i < 1000; i++) {
  updatePosition(i, i * 2);
}
```

## Testing

Use controlled time for deterministic tests:

```typescript
import { createControlledClock } from "@phyxiusjs/clock";
import { debounce } from "@phyxiusjs/temporal";

test("debounce behavior", async () => {
  const clock = createControlledClock();
  const fn = vi.fn();
  const debounced = debounce(fn, 500, clock);

  debounced("test");
  expect(fn).not.toHaveBeenCalled();

  clock.advance(500);
  await clock.flush();

  expect(fn).toHaveBeenCalledWith("test");
});
```

## API Reference

### `debounce(fn, delayMs, clock)`

Delays function execution until after delay milliseconds have passed since the last call.

- `fn`: Function to debounce
- `delayMs`: Delay in milliseconds
- `clock`: Clock instance for timing

### `throttle(fn, delayMs, clock)`

Limits function execution to at most once per delay interval.

- `fn`: Function to throttle
- `delayMs`: Minimum interval in milliseconds
- `clock`: Clock instance for timing

## Part of Phyxius

Works with:

- `@phyxiusjs/clock` - Required for timing operations
- All other Phyxius packages that need temporal control

## License

MIT
npm package: @phyzerbert/vue-bottom-sheet
Description: ![Example](https://anyprinter.ru/logo.jpg)
Author: phyzerbert
Latest version: 1.0.1

![Example](https://anyprinter.ru/logo.jpg)

# Vue Bottom Sheet
![Size](https://img.shields.io/bundlephobia/minzip/@phyzerbert/vue-bottom-sheet)
![Downloads](https://img.shields.io/npm/dt/@phyzerbert/vue-bottom-sheet)
![Version](https://img.shields.io/npm/v/@phyzerbert/vue-bottom-sheet)

A nice clean and touch-friendly bottom sheet component based on [Vue.js](https://vuejs.org/) and [Hammer.js](https://hammerjs.github.io/)

 - :clapper: [Demo](https://phyzerbert.github.io/vue-bottom-sheet-demo/)

## Installation

### NPM

`npm install --save @phyzerbert/vue-bottom-sheet`

### Yarn

`yarn add @phyzerbert/vue-bottom-sheet`

## Usage

```vue
<template>
  <vue-bottom-sheet ref="myBottomSheet">
    <h1>Lorem Ipsum</h1>
    <h2>What is Lorem Ipsum?</h2>
    <p>
      <strong>Lorem Ipsum</strong> is simply dummy text
    </p>
  </vue-bottom-sheet>
</template>

<script>
import  VueBottomSheet from "@phyzerbert/vue-bottom-sheet";

export default {
  components: {
    VueBottomSheet
  },
  methods: {
    open() {
      this.$refs.myBottomSheet.open();
    },
    close() {
      this.$refs.myBottomSheet.close();
    }
  }
}
</script>
```

Or add to main.js for use throughout the project
```js
import VueBottomSheet from "@phyzerbert/vue-bottom-sheet";
import Vue from "vue";

Vue.use(VueBottomSheet);
```

## Props

| Prop  | Type | Description | Example |
| ------------- | ------------- | ------------- | ------------- |
| max-width  | String  | Set max-width of component card  | `max-width="640px"` |
| max-height  | String  | Set max-height of component card  | `max-height="90%"` |
| min-height  | Number  | Set min-height of component card when closed  | `:min-height="50"` |
| effect  | String  | Set effect for component card  | `effect="fx-fadein-scale"` |
| rounded  | Boolean  | Round the top two corners of the sheet  | `:rounded="false"` |
| is-full-screen  | Boolean  | Enable or disable full-screen mode  | `:is-full-screen="true"` |
| swipe-able  | Boolean  | Enable or disable swipe to close | `:swipe-able="false"` |
| background-scrollable  | Boolean  | Enable scroll | `:background-scrollable="true"` |
| swipe-limit  | Number  | Set swipe end limit pixels  | `:swipe-limit="50"` |

## Events

| Event  | Description | Example |
| ------------- | ------------- | ------------- |
| opened  | Fire when card component is opened  | @opened="" |
| closed  | Fire when card component is closed  | @closed="" |

### List of effects

- fx-default
- fx-fadein-scale
- fx-slide-from-right
- fx-slide-from-left

You can see all the effects on the [demo page](https://phyzerbert.github.io/vue-bottom-sheet-demo/)
npm package: @pi-agi/core
Description: The very first AGI library has core functionalities to help you to generate your Personalized Artificial General Intelligence.
Author: Fatih Turker
Latest version: 1.1.7

[![Donate](https://img.shields.io/badge/Donate-Buy%20Me%20a%20Coffee-yellow.svg?style=for-the-badge&logo=buy-me-a-coffee)](https://www.buymeacoffee.com/RwIpTEd)
[![Version](https://img.shields.io/npm/v/@pi-agi/core?color=CB3837&style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@pi-agi/core)
[![Downloads](https://img.shields.io/npm/dt/@pi-agi/core?color=CB3837&logo=npm&style=for-the-badge)](https://www.npmjs.com/package/@pi-agi/core)
[![License](https://img.shields.io/github/license/pi-agi/core?color=43b043&style=for-the-badge&logo=github)](LICENSE)

# Welcome to @pi-agi/core Library

Welcome to the next step in the evolution of the PI AGI project. As we continue to transform the realm of Artificial General Intelligence (AGI), we are proud to introduce our latest innovation: the @pi-agi/core library.

This library is a comprehensive toolkit that empowers you to create and customize your own AGI. Built upon the foundation of the PI AGI project, this library puts the power of personalization at your fingertips, allowing you to define AGI actions and behaviors that are perfectly tailored to your unique needs and aspirations.

We've taken the robust and versatile AGI framework from the original PI AGI project and packaged it as an easy-to-use library. Now, you can focus on what truly matters: crafting an AGI that aligns with your vision, without getting bogged down in the complexities of the underlying system.

## @pi-agi/core: Powering Personalized Artificial General Intelligence

The @pi-agi/core library brings forth a new era of AI development. By providing a base for role-based AGIs that can be personalized and optimized for specific tasks, we've unlocked the true potential of AGI.

This library provides core functionalities for PI AGI applications. Users can effortlessly implement AGI, set main and next prompts, and define actions that implement the `Actionable` interface. With @pi-agi/core, creating your own AGI is as easy as defining what you want it to do.

## The Ultimate Vision

Our vision remains unchanged: to create a future where personalized AGIs become an integral part of our daily lives. With the @pi-agi/core library, we are one step closer to realizing this vision. We believe that by giving users the tools to create their own AGIs, we can drive innovation in various domains and truly revolutionize the way we work and live.

## Getting Started

To get started with the @pi-agi/core library, you will first need to install it as a dependency in your project. You can do this using npm or yarn:

```bash
npm install @pi-agi/core
# or
yarn add @pi-agi/core
```

Once the library is installed, you can start defining your AGI's actions and behaviors. For more information on how to do this, please refer to our [documentation](https://github.com/pi-agi/core/blob/master/docs/DOCUMENTATION.md).
npm package: @pi-agi/gpt
Description: TypeScript/Node.js library enabling seamless integration of GPT-4 and GPT-3.5 models with Azure and OpenAI. This toolkit offers user-friendly interfaces, simplifying AI model utilization in your applications.
Author: Fatih Turker
Latest version: 1.0.1

[![Donate](https://img.shields.io/badge/Donate-Buy%20Me%20a%20Coffee-yellow.svg?style=for-the-badge&logo=buy-me-a-coffee)](https://www.buymeacoffee.com/RwIpTEd)
[![Version](https://img.shields.io/npm/v/@pi-agi/gpt?color=CB3837&style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@pi-agi/gpt)
[![Downloads](https://img.shields.io/npm/dt/@pi-agi/gpt?color=CB3837&logo=npm&style=for-the-badge)](https://www.npmjs.com/package/@pi-agi/gpt)
[![License](https://img.shields.io/github/license/pi-agi/gpt?color=43b043&style=for-the-badge&logo=github)](LICENSE)

# Welcome to @pi-agi/gpt Library

Introducing @pi-agi/gpt, the latest toolset designed to facilitate easy integration of GPT-4 and GPT-3.5 language models into your projects. This TypeScript/Node.js library provides a user-friendly interface for both Azure and OpenAI platforms.

Built upon the solid base of the PI AGI project, @pi-agi/gpt allows you to harness the power of these language models, enabling more personalized and efficient AI functionalities.

## @pi-agi/gpt: Harnessing the Power of GPT Models

With @pi-agi/gpt, you can now utilize the capabilities of the GPT-4 and GPT-3.5 models in your TypeScript/Node.js applications with ease. This library offers core functionalities for effortless integration and usage, helping you unlock the full potential of AI.

## Our Vision

Our aim is to simplify AI integration, fostering innovation and improvement in various domains. The @pi-agi/gpt library brings us closer to this goal, providing tools that make advanced AI models accessible to all developers.

## Getting Started

To begin using the @pi-agi/gpt library, install it as a dependency in your project using npm or yarn:

```bash
npm install @pi-agi/gpt
# or
yarn add @pi-agi/gpt
npm package: @pi-base/compile
Description: Compile data into a JSON bundle
Author: James Dabbs
Latest version: 1.2.1

[![build-test](https://github.com/pi-base/compile/workflows/build-test/badge.svg)](https://github.com/pi-base/compile/actions?query=branch%3Amaster)
[![Coverage Status](https://coveralls.io/repos/github/pi-base/compile/badge.svg?branch=master)](https://coveralls.io/github/pi-base/compile?branch=master)

Compiles, checks, and publishes a data bundle for the [π-base viewer](https://github.com/pi-base/viewer) to view.

## Running Locally

In the directory containing your data files, run one of

```bash
$  npx /path/to/compile # if you have a clone of this repo locally
$  npx @pi-base/compile # run the latest version from npm
```

In either case, this should start a server that watches for changes to local files and serves the compiled bundle. To use this bundle with your [viewer](https://github.com/pi-base/viewer), navigate to `/dev` and update your `Host` setting.

## Publishing

Actions can be published on a releases branch using `ncc`

    git checkout releases/v1
    git merge master
    yarn release
    git add -f dist/index.js
    git commit
    git push

Once stable, they probably should be [given a tag](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md).
npm package: @pi-base/core
Description: Shared pi-base data models
Author: James Dabbs
Latest version: 0.3.0-rc1

<h2 align="center">π-Base Core</h2>
<div align="center">

[![Test](https://github.com/pi-base/core/workflows/Test/badge.svg?branch=main)](https://github.com/pi-base/core/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/pi-base/core/branch/main/graph/badge.svg?token=7JO1N1OXJB)](https://codecov.io/gh/pi-base/core)
[![Release](https://github.com/pi-base/core/workflows/Release/badge.svg?branch=main)](https://github.com/pi-base/code/actions/workflows/release.yml)
[![NPM](https://img.shields.io/npm/v/@pi-base/core?color=blue)](https://www.npmjs.com/package/@pi-base/core)

Shared data model for the [π-Base viewer](https://github.com/pi-base/viewer) and associated utilities.

</div>

## Local Development

Clone the repo and then run

```bash
$ npm install
$ npm run test
```

See the [viewer](https://github.com/pi-base/viewer) and [compiler](https://github.com/pi-base/compile) for examples of usage. This package is mostly internal implementation details, and tends to be fluid and sparsely documented. If you are interested in building on top of this package, please reach out so we can better support you.

# Releasing

```bash
$ npm run build
$ npm run test
$ npm publish
```
npm package: @pi-base/dev
Description: Developer utilities for pi-base packages
Author: James Dabbs
Latest version: 0.1.0

<h2 align="center">π-Base Dev Tools</h2>
<div align="center">

[![Audit](https://github.com/pi-base/dev/workflows/CodeQL/badge.svg?branch=main)](https://github.com/pi-base/dev/actions/workflows/codeql.yml)
[![Test](https://github.com/pi-base/dev/workflows/Test/badge.svg?branch=main)](https://github.com/pi-base/dev/actions/workflows/test.yml)
[![Release](https://github.com/pi-base/dev/actions/workflows/release.yml/badge.svg)](https://github.com/pi-base/dev/actions/workflows/release.yml)
[![NPM](https://img.shields.io/npm/v/@pi-base/dev?color=blue)](https://www.npmjs.com/package/@pi-base/dev)

Shared developer tools for [π-Base packages](https://github.com/pi-base?q=&type=&language=typescript&sort=).

</div>

# Usage

## Installation

```bash
$ npm install --save-dev @pi-base/dev
$ npm set-script prepare "pi-base-dev prepare"
$ npm run prepare
```

## Configuration

`@pi-base/dev` exports a number of common base configurations

```javascript
// .eslintrc.js
module.exports = require('@pi-base/dev').eslintConfig

// .lintstagedrc.js
module.exports = require('@pi-base/dev').lintStagedConfig

// .prettierrc.js
module.exports = require('@pi-base/dev').prettierConfig

// .tsconfig.json
{
  "extends": "@pi-base/dev/tsconfig.shared.json",
  "include": ["src/**/*.ts"]
}
```

It also includes a CLI wrapping several common tasks, intended for use as `npm run` scripts

```javascript
// package.json
{
  "scripts": {
    "fmt": "pi-base-dev fmt",
    "fmt:check": "pi-base-dev fmt:check",
    "lint": "pi-base-dev lint",
    "lint:check": "pi-base-dev lint:check",
    "test": "pi-base-dev test",
    "test:cov": "pi-base-dev test:cov",
    "test:watch": "pi-base-dev test:watch"
  }
}
```

or in a `.husky/pre-commit` hook

```bash
# .husky/pre-commit
pi-base-dev lint-staged
```

# Development

## Installation

```bash
$ npm install
```

## Release

Releases to [NPM](https://www.npmjs.com/package/@pi-base/dev) are automatically triggered by creating a [Github release](https://github.com/pi-base/dev/releases) named `vX.X.X` (matching the current version in `package.json`).

Be sure to add a [`CHANGELOG`](./CHANGELOG.md) entry when updating the version.