open-index/open-npm huggingface dataset:
npm package: @linnenschmidt/build-ng-packagr
Description: Angular Build Architect for ng-packagr with asset handling
Author: Linnenschmidt
Latest version: 9.0.0

# Angular Build Architect for ng-packagr with asset handling

The default Angular build architect _@angular-devkit/build-ng-packagr_ for ng-packagr doesn't copy assets of libraries.
Most library projects have assets which was mentioned here
[/angular/angular-cli/issues/11071](https://github.com/angular/angular-cli/issues/11071#issuecomment-451271094).

This Angular Build Architect solves the known issue of _@angular-devkit/build-ng-packagr_ even if you only copy assets.

## How to install

Install `@linnenschmidt/build-ng-packagr` into your angular project.
```bash
npm install @linnenschmidt/build-ng-packagr --save-dev
```
or
```bash
yarn add @linnenschmidt/build-ng-packagr --dev
```

## How to use

1. Replace the build architect of your libraries by  `@linnenschmidt/build-ng-packagr:build`.
    ```json
   "architect": {
     "build": {
       "builder": "@linnenschmidt/build-ng-packagr:build",
    ```
2. Add your assets glob rules to the options section like as you normally do for apps
    ```json
   "options": {
     "project": "projects/lib/ng-package.json",
     "tsConfig": "projects/lib/tsconfig.lib.json",
     "assets": [
       "src/assets",
       {
         "glob": "**/*.css",
         "input": "src/some-assets",
         "output": "assets/some-assets"
       }
     ]
   }
    ```
    
A final angular.json file could look like the following example:
```json
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "projects": {
    "lib": {
      "root": "projects/lib",
      "projectType": "library",
      "architect": {
        "build": {
          "builder": "@linnenschmidt/build-ng-packagr:build",
          "options": {
            "project": "projects/lib/ng-package.json",
            "tsConfig": "projects/lib/tsconfig.lib.json",
            "assets": [
              "src/assets",
              {
                "glob": "**/*.css",
                "input": "src/some-assets",
                "output": "assets/some-assets"
              }
            ]
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "projects/lib/src/test.ts",
            "tsConfig": "projects/lib/tsconfig.spec.json",
            "karmaConfig": "projects/lib/karma.conf.js"
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "projects/lib/tsconfig.lib.json",
              "projects/lib/tsconfig.spec.json"
            ],
            "exclude": ["**/node_modules/**"]
          }
        }
      }
    }
  }
}

```
## CLI commands for development

**Test package**
```bash
yarn test
```

**Build package**
```bash
yarn build
```

## Two of the known issues

- [angular/angular-cli/issues/11071](https://github.com/angular/angular-cli/issues/11071)
- [ng-packagr/ng-packagr/issues/1092](https://github.com/ng-packagr/ng-packagr/issues/1092)
npm package: @linnhtun/react-hook-form-persist
Description: Persist and populate react-hook-form form using storage of your choice
Author: Tiaan du Plessis
Latest version: 2.1.1


# react-hook-form-persist
[![package version](https://img.shields.io/npm/v/react-hook-form-persist.svg?style=flat-square)](https://npmjs.org/package/react-hook-form-persist)
[![package downloads](https://img.shields.io/npm/dm/react-hook-form-persist.svg?style=flat-square)](https://npmjs.org/package/react-hook-form-persist)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![package license](https://img.shields.io/npm/l/react-hook-form-persist.svg?style=flat-square)](https://npmjs.org/package/react-hook-form-persist)
[![make a pull request](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

> Persist and populate [react-hook-form](https://react-hook-form.com/) form using storage of your choice

## Table of Contents

- [Usage](#usage)
- [Install](#install)
- [Contribute](#contribute)
- [License](#License)

## Usage

```js
import React from "react";
import ReactDOM from "react-dom";
import useForm from "react-hook-form"

import useFormPersist from 'react-hook-form-persist'

function App() {
  const { register, handleSubmit, watch, errors, setValue } = useForm();

  useFormPersist("foo", {watch, setValue}, {
    storage: window.localStorage, // default window.sessionStorage
    exclude: ['foo']
  });


  const onSubmit = data => {
    console.log(data);
  };


  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <input name="example" defaultValue="test" ref={register} />

      <input name="exampleRequired" ref={register({ required: true })} />
      {errors.exampleRequired && <span>This field is required</span>}

      <input name="foo" defaultValue="bar" ref={register} />

      <input name="bar" defaultValue="foo" ref={register} />

      <input type="submit" />
    </form>
  );
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

```

### Additional examples


Persist all form fields:

```js
useFormPersist('form', {watch, setValue});
```

Persist all form fields except password:

```js
useFormPersist('form', {watch, setValue}, { exclude: ['password'] });
```

Persist only the email field:

```js
useFormPersist('form', {watch, setValue}, { include: ['email'] });
```


## Install

This project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com).

```sh
$ npm install react-hook-form-persist
$ # OR
$ yarn add react-hook-form-persist
```

## Contribute

1. Fork it and create your feature branch: `git checkout -b my-new-feature`
2. Commit your changes: `git commit -am "Add some feature"`
3. Push to the branch: `git push origin my-new-feature`
4. Submit a pull request

## License

MIT © Tiaan du Plessis