# @jilio/addnew

> A utility for adding new components using feature-sliced methodology

Latest version **1.0.6** (published 2023-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jilio/addnew
pnpm add @jilio/addnew
yarn add @jilio/addnew
bun add @jilio/addnew
```

Provides the command `addnew`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-05-24 |
| First published | 2023-05-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | jilio |
| Maintainers | jilio |

## Links

- npm: https://www.npmjs.com/package/@jilio/addnew
- Repository: https://github.com/jilio/addnew
- Homepage: https://github.com/jilio/addnew#readme
- Issues: https://github.com/jilio/addnew/issues
- npm.io page: https://npm.io/package/@jilio/addnew

## Recent versions

- 1.0.6 (latest) — 2023-05-24
- 1.0.5 — 2023-05-21
- 1.0.4 — 2023-05-20
- 1.0.3 — 2023-05-20
- 1.0.2 — 2023-05-20
- 1.0.1 — 2023-05-20
- 1.0.0 — 2023-05-20

## README

# Addnew

`addnew` is a command-line utility designed to simplify the creation of new components in your feature-sliced architecture.

This tool supports the generation of various component types such as pages, widgets, features, entities, and shared. It also takes care of correctly updating paths in your `tsconfig.json` file.

## Installation

```bash
yarn add -D @jilio/addnew
```

For easier access, you can add it to the scripts section of your `package.json`:

```json
"scripts": {
  "addnew": "npx @jilio/addnew"
}
```

## Usage

To create a new component, use the following syntax:

```bash
npx @jilio/addnew <component_type> <component_name>
```

`<component_type>` should be one of the following:

- page
- widget
- feature
- entity
- shared

`<component_name>` is the name of your new component.

For example, to create a new feature named ThemeToggle, you would run:

```bash
npx @jilio/addnew feature ThemeToggle
```

or

```bash
yarn addnew feature themeToggle
```

This will create a new directory in your `src/4_features` directory named ThemeToggle, with a React component file (ThemeToggle.tsx) and an index.ts file.

### Note

For `shared` type, it just creates a single `.ts` file instead of a full component structure. For example:

```bash
npx @jilio/addnew shared router
```

This will create a new router.ts file in your `src/6_shared` directory.

## License

MIT

---
_Source: https://npm.io/package/@jilio/addnew · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
