open-index/open-npm huggingface dataset:
npm package: @renanhangai/env-builder
Description: Create .env files for your projects with a single command
Author: renanhangai
Latest version: 0.4.3

# Basic usage

Install using `yarn add @renanhangai/env-builder`

Create a `template.env`

```env
APP_NAME=example-app
APP_PASSWORD={{util.random(16)}}
APP_HOST=myapp.example.com
APP_CONNECTION_URL=http://${APP_HOST}/data
```

Create a `.env.local`

```env
APP_HOST=myapp.localhost
```

Configure it using:

```sh
yarn run env-builder generate -t template.env -i .env.local -o .env
```

The generated output will be

```env
APP_NAME=example-app
APP_PASSWORD=somerandomdata12
APP_HOST=myapp.example.com
APP_CONNECTION_URL=http://myapp.localhost/data
```

# Guide

Now that you know what this library does, let's explain what each flag of the following command

```sh
yarn run env-builder generate -t template.env -i .env.local -o .env
```

The `-t/--template [file]` flag is the template option, it will use it as a base file to generate your .env, it will be also considered the first input file to set the environment variable values

The `-i/--input [file]` flag may be used to read and override the variables on the template, it can also have additional variables. You can use this flag multiple times on the same command.

The `-o/--output [file]` flag is used to write the environment file generated by this command.

The `--env-override-prefix <prefix>` flag is usually combined when using CI. It allows the variables to be overwritten by environment variables of the same name, but prefixed with `prefix`.

-   Example: When using `--env-override-prefix CI_OVERRIDE_` you can set the env `CI_OVERRIDE_APP_NAME=my-ci-app` to override the variable `APP_NAME`

# `package.json` mode

You can simplify the usage of the scripts simply by creating the `env-builder` entry on the package.json file

```json
{
	"devDependencies": {
		"@renanhangai/env-builder": "^0.4.0"
	},
	"scripts": {
		"env": "env-builder generate --package --",
		"env:ci": "env-builder generate --package --env-override-prefix CI_OVERRIDE_ --"
	},
	"env-builder": {
		"template": "env/template.env",
		"output": ".env", // Or array [".env", "output/.env"]
		"local": ".env.local",
		"modes": {
			"dev": ["env/development.env"],
			"prod": ["env/production.env"]
		}
	}
}
```

And the running `yarn env`
npm package: @renanhangai/nestjs-context
Description: NestJS context
Author: renanhangai
Latest version: 0.2.1

# nestjs-context

Generate a context for every request on nestjs

By using interceptors, this library can help you setup a new context object
for every request to manage things like transactions and custom data per
request without using the Request Scope

## Usage

Create the interceptor

```ts
import { Injectable } from "@nestjs/common";
import {
	RequestContext,
	RequestContextInterceptor,
	RequestMiddlewareState,
	RequestContextMiddlewareNextCallback,
} from "@renanhangai/nestjs-context";

export interface ContextType {
	dbConnection: Connection;
}

/// Re-export the decorator
export { RequestContext };

/// Export the interceptor
@Injectable()
export class MyContextInterceptor extends RequestContextInterceptor<ContextType> {
	/// The middleware
	middlewares() {
		return [
			this.middlewareTransaction,
		],
	}
	/// Apply the middleware for the transaction
	async middlewareTransaction(
		state: RequestMiddlewareState<ContextType>,
		next: any
	) {
		await this.database.transaction( (connection) => {
			state.context.dbConnection = connection;
			await next();
			state.context.dbConnection = null;
		});
	}
}
```

Use it on your application

```ts
import { Module } from "@nestjs/common";
import { APP_INTERCEPTOR } from "@nestjs/core";
import { MyContextInterceptor } from "./somewhere";

@Module({
	proviers: [
		{
			provide: APP_INTERCEPTOR,
			useClass: MyContextInterceptor,
		},
	],
})
class AppModule {}
```
npm package: @renanhangai/nuxt-helper-config
Description: Generate helper configuration for nuxt
Author: renanhangai
Latest version: 1.2.0

# nuxt-helper-config

Basic Usage
----------------------

```ts
const helper = require( "@renanhangai/nuxt-helper-config" );

const generator = helper.create({
  /*
    Project root dir. (Where package.json is located)
  */
  rootDir: String,
  /*
    Where files will be put
  */
  buildDir: String,
  /*
    Object with default options for every config generated
  */
  defaults: Object,
});

/*
  srcDir is the name of the nuxt source directory
 */
generator( srcDir, {
  /*
    Alias for modules being imported.
  */
  alias: Object,
  /*
    Array of css to be included on the build
  */
  css: Array,
  plugins: Array,
  modules: Array,
  middleware: Array,
  /*
    Map with constants to be defined during compilation phase
  */
  define: Map< String, any >,
  provide: Map< String, String|Array<String> >,
});
```
npm package: @renanhangai/nuxt-test
Description: Nuxt Test Module
Author: renanhangai
Latest version: 0.1.1

nuxt-test
=============================================

Create tests using tape for your nuxt components.

## Getting Started ##

Just add the module to your nuxt.config
```js
// nuxt.config.js
module.exports = {
	// ...
	modules: [ 
		['@renanhangai/nuxt-test', { enable: +process.env.NODE_ENV_TEST }]
	],
};
```
And create your tests on the components

```vue
<template>
   <div />
</template>
<script>
export default {
	
};
</script>
<test>
export default async function ( t, component ) {
	t.pass( 'ok' );
}
</test>
```
npm package: @renanhangai/vue-components
Description: Componentes extras para auxiliar nos projetos
Author: renanhangai
Latest version: 0.5.5

# vue-components

Vue sample components

# Nuxt

On `nuxt.config.js`

```js
module.exports = {
	// ...
	modules: [
		// ...
		[
			'@renanhangai/vue-components/nuxt',
			{
				framework: 'buefy',
				options: {
					// Framework options
				},
			},
		],
	],
};
```

BuefyOptions

```ts
export type VueComponentBuefyPluginOptions = {
	prefix?: string;

	inputFileIconDefault?: string;
	inputFileIconDisabled?: string;
	inputFileIconRemove?: string;

	// More masks
	inputMasks?: {
		[key: string]: any;
	};
};
```

# Components

<!-- START COMPONENTS -->

# InfiniteList

Creates an infinite list. The list will grow as every item is being filled.

## Props

<!-- @vuese:InfiniteList:props:start -->
|Name|Description|Type|Required|Default|
|---|---|---|---|---|
|item|The item to be generate when the list requires a new one|`Function` / `Object`|`false`|-|
|isItemEmpty|Check if the item is empty (to be removed from the list)|`Function`|`false`|isItemEmptyDefault|
|itemClass|The item class|`String`|`false`|-|
|transition|The transition name to apply|`String`|`false`|'transition'|
|data|Data to pass to the item slot|`Object`|`false`|-|
|value|Array of items|`Array`|`false`|-|
|disabled|Check if can create new items|`Boolean`|`false`|-|

<!-- @vuese:InfiniteList:props:end -->


## Events

<!-- @vuese:InfiniteList:events:start -->
|Event Name|Description|Parameters|
|---|---|---|
|input|-|-|

<!-- @vuese:InfiniteList:events:end -->




# Table

Better table for buefy

## Props

<!-- @vuese:Table:props:start -->
|Name|Description|Type|Required|Default|
|---|---|---|---|---|
|items|-|`Array`|`false`|-|
|columns|-|`Array`|`false`|-|
|actions|-|`Array`|`false`|-|
|rowTo|-|`Function`|`false`|-|
|loading|-|`Boolean`|`false`|-|
|emptyText|-|`String`|`false`|'Nenhum item encontrado'|

<!-- @vuese:Table:props:end -->


## Events

<!-- @vuese:Table:events:start -->
|Event Name|Description|Parameters|
|---|---|---|
|click|-|-|

<!-- @vuese:Table:events:end -->




# InputFile

## Props

<!-- @vuese:InputFile:props:start -->
|Name|Description|Type|Required|Default|
|---|---|---|---|---|
|value|-|`String` / `File`|`false`|-|
|disabled|-|`Boolean`|`false`|-|
|loading|-|`Boolean`|`false`|-|
|removable|-|`Boolean`|`false`|true|
|placeholder|-|`String`|`false`|null|

<!-- @vuese:InputFile:props:end -->


## Events

<!-- @vuese:InputFile:events:start -->
|Event Name|Description|Parameters|
|---|---|---|
|input|-|-|

<!-- @vuese:InputFile:events:end -->




# TableSearch

## Props

<!-- @vuese:TableSearch:props:start -->
|Name|Description|Type|Required|Default|
|---|---|---|---|---|
|search|-|`Array` / `String`|`true`|-|
|searchOptions|-|`Object`|`false`|-|
|searchPlaceholder|-|`String`|`false`|'Digite para searchr'|
|items|-|`Array`|`false`|-|

<!-- @vuese:TableSearch:props:end -->






<!-- END COMPONENTS -->
npm package: @renanhangai/vue-di
Description: Dependency injection for vue
Author: renanhangai
Latest version: 0.2.0

# vue-di

Dependency Injection for vue, made simple.

## Basic Usage

Simple usage

`Data.service.ts`

```ts
import { injectable } from 'tsyringe';

@injectable()
class DataService {
	constructor() {}

	doSomething() {}
}
```

`User.service.ts`

```ts
import { singleton } from 'tsyringe';
import { DataService } from './Data.service';
import { ReplaySubject } from 'rxjs';

@singleton()
class UserService {
	private readonly usuario$ = new ReplaySubject(1);
	constructor(private readonly dataService: DataService) {}

	async login() {
		this.dataService.doSomething();
		this.usuario$.next({ id: 1, name: "John Doe" });
		return request(...);
	}

	fetch$() {
		return this.usuario$;
	}
}
```

`Component.vue`

```ts
//<template><div>{{user}}</div></template>
import { UserService } from 'services/User.service';

export default {
	services: {
		userService: UserService,
	},
	servicesData: {
		user: {
			service: UserService,
			method: 'fetch$',
		},
	},
	methods: {
		async login() {
			await this.$services.userService.login();
		},
		doSomethingWithUser() {
			if (!this.user) return 'Invalid user';
			send(this.user.name);
		},
	},
};
```

## Installation

```sh
yarn add @renanhangai/vue-di reflect-metadata
```

### Installation with **nuxt**

on your entrypoint

```js
import 'reflect-metadata';
import Vue from 'vue';
import VueDi from '@renanhangai/vue-di';

Vue.use(VueDi, options);
```

on `vue.config.js`

```js
module.exports = {
	transpileDependencies: ['@renanhangai/vue-di'],
};
```

### Installation with **nuxt**

```js
export default {
	modules: ['@renanhangai/vue-di/nuxt'],
	build: {
		transpile: ['@renanhangai/vue-di'],
	},
};
```

## ServiceData

When using servicesData, you may return a few things

### Observable

Returning an observable makes the component subscribe to it and react to its changes

### Promise

### Value

### DataFetcher

Returning an object with an observable\$ method or property will subscribe to it and allow a few more options
npm package: @renanhangai/vue-select
Description: Vue Select
Latest version: 0.1.6

vue-select
===========================

Select component


### Props ###
- `items`

  The options for the select, can be any of the types below:
  - `null`: The dropdown will show a loading message
  - `Array`: Array of objects or strings containing the options
  - `String`: Message to appear on the dropdown
  - `Function`: A function that receives the search string and may return any of the above, or a promise that resolves to any of the above types.
  
- `placeholder`

  The placeholder when no field is selected

- `multiple`

  `Boolean` flag to allow multiple selected values (default: false)

- `search`

  `Boolean` flag to show the search field or not (default: true)
npm package: @renanhangai/vue-submit
Description: Vue submit helper
Author: renanhangai
Latest version: 2.3.0

vue-submit
=======================

Helper for requests with confirmation, notification and loading status.

### Instalation ###

```js
import Vue from 'vue';
import VueSubmit from 'vue-submit';

// Default options
Vue.use( VueSubmit );

// Or by using a framework name
Vue.use( VueSubmit, "buefy" );

// Or using full options 
Vue.use( VueSubmit, {
	//! Framework to set
	framework?: SubmitOptionsFramework,
	//! Confirmation function to be called on the confirmation step
	confirmation?: ( vm: any, confirmationData: any ) => any,
	confirmationDefaults?: any,
	//! Notification function to be called on notify step
	notify?: ( vm: any, notifyData: any, notifyDefaults?: any ) => any,
	notifyDefaults?: any,
	notifyDefaultsError?: any,
	notifyDefaultsErrorValidation?: any,
	//! Set the request function
	request?: ( vm: any, requestData: any ) => any,
	requestDefaults?: any,
	//! Compatibility options { Promise } for now
	compat: SubmitManagerCompatOptions,
}); 
```

### Usage ####
```js

this.$submit( "name", {
	//! The validator to use (vuelidate compatible)
	validator?: any,
	//! Set to false if you do not want to trigger the loading bar from nuxt
	loading?:   Boolean,
	//! Override the request functions
	request?: ( vm: any, requestData: any ) => any,
	//! Function to be called on success
	success?: ( result: any ) => any,
	//! Confirmation object passed to constructor
	confirmation?: any,
	//! Notify options on success and errors
	notify?: any,
	notifyError?: any,
});
```

### Capturing errors ###

```js
this.$submit( "name", {
	notifyError({ data }) {
		// do something with the data
	}
})
```