# @tuentyfaiv/cli

> A CLI to generate base code for React, Svelte and Vanilla JS projects, like boilerplates, components, pages, etc.

Latest version **0.0.11** (published 2023-11-23) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @tuentyfaiv/cli
pnpm add @tuentyfaiv/cli
yarn add @tuentyfaiv/cli
bun add @tuentyfaiv/cli
```

Provides the command `tfverse`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2023-11-23 |
| First published | 2023-08-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 1 |
| Author | Tonalli López |
| Maintainers | tuentyfaiv |
| Keywords | CLI, Frontend, TuentyFaiv, React, Svelte, Vanilla JS, Boilerplates, Components, Pages |

## Links

- npm: https://www.npmjs.com/package/@tuentyfaiv/cli
- Repository: https://github.com/TuentyFaiv/generate
- Homepage: https://github.com/TuentyFaiv/generate#readme
- Issues: https://github.com/TuentyFaiv/generate/issues
- npm.io page: https://npm.io/package/@tuentyfaiv/cli

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.4.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.11 (latest) — 2023-11-23
- 0.0.10 — 2023-09-25
- 0.0.9 — 2023-09-08
- 0.0.8 — 2023-08-07
- 0.0.7 — 2023-08-07
- 0.0.6 — 2023-08-07
- 0.0.5 — 2023-08-07
- 0.0.4 — 2023-08-06

## README

# Generate CLI
With this CLI you can generate base code to start to program fast. Also you can personalize the base code to generate.

## Options
```zsh
A command line interface for Frontend development

Usage: tfverse [OPTIONS] [NAME]

Arguments:
  [NAME]  Project name

Options:
  -t, --tool <TOOL>          Template tool to choose
  -a, --arch <ARCH>          Frontend piece or project template
  -l, --language <LANGUAGE>  TypeScript or JavaScript
  -s, --styles <STYLES>      Styles type
  -p, --path <PATH>          Template path to generate
  -y, --sure                 Accept all questions
  -g, --global               Set configuration
  -c, --config <FILE>        Config file to customize this CLI
  -h, --help                 Print help
  -V, --version              Print version
```

## Config file
To personalize the cli you must create a `.json` file. And use the following [schema](https://gvtmpjzawvdhojsxlece.supabase.co/storage/v1/object/public/cli/schema/config.json).

The commented paths are the default values.
### Exmaple `tfverse_config.json`
```json
{
  "$schema": "https://gvtmpjzawvdhojsxlece.supabase.co/storage/v1/object/public/cli/schema/config.json",
  "repository": "git@github.com:YOUR_ORG_OR_YOUR_USER",
  "root": "", // The project root, default is "./"
  "paths": { // The modules paths
    "globals": {
      "contexts": null, // "./src/logic/contexts"
      "schemas": null, // "./src/logic/schemas"
      "services": null, // "./src/logic/services"
      "types": null, // "./src/logic/typing"
      "ui": null // "./src/ui"
    },
    "react": {
      "hocs": null, // "./src/logic/hocs"
      "hooks": {
        "global": null, // "./src/logic/hooks"
        "internal": null // "hooks"
      },
      "locales": null, // "./public/locales"
      "routes": null // "./src/logic/routes"
    },
    "svelte": {
      "actions": null, // "./src/logic/actions"
      "layouts": null, // "./src/routes"
      "locales": null, // "./static/locales"
      "pages": null, // "./src/routes"
      "stores": null // "./src/logic/stores"
    },
    "vanilla": {
      "classes": null, // "./src/logic/classes"
      "functions": null // "./src/logic/functions"
    }
  },
  "tools_type": { // The list to generate libraries and projects boilerplates
    "vanilla": [
      [
        "base", // Name to show in the list
        {
          "name": "REPOSITORY_NAME",
          "project": "main",
          "library": null
        }
      ]
    ],
    "react": [
      [
        "base", // Name to show in the list
        {
          "name": "REPOSITORY_NAME",
          "project": "main",
          "library": null
        }
      ]
    ],
    "svelte": [
      [
        "base", // Name to show in the list
        {
          "name": "REPOSITORY_NAME",
          "project": "main",
          "library": null
        }
      ]
    ]
  },
  "templates": { // The paths to your custom templates, all paths are concat with "$HOME"
    "react": {
      "component": null, // Example: "path/to/your/folder/component"
      "context": null,
      "hoc": null,
      "hook": null,
      "layout": null,
      "page": null,
      "schema": null,
      "service": null
    },
    "svelte": {
      "action": null,
      "context": null,
      "layout": null,
      "page": null,
      "schema": null,
      "service": null,
      "store": null,
      "component": null
    },
    "vanilla": {
      "class": null,
      "component": null,
      "function": null,
      "layout": null,
      "page": null,
      "schema": null,
      "service": null
    }
  }
}
```

## Templates paths
If you want to personalize this CLI you must create the following files inside the folders that you set in the `templates` option.
### React Component
| Path | To |
| --- | --- |
| `/component.(ts\|js)x` | Component |
| `/import.(ts\|js)` | Component imports |
| `/proptypes.ts` | Component props |
| `/styles.(ts\|js)` | Component styles |
| `/styles.responsive.(ts\|js)` | Component responsive |
### Svelte Component
| Path | To |
| --- | --- |
| `/component.svelte` | Component |
| `/script.(ts\|js).svelte` | Component script |
| `/import.(ts\|js)` | Component imports |
| `/proptypes.ts` | Component props |
| `/styles.(ts\|js)` | Component styles |
| `/styles.responsive.(ts\|js)` | Component responsive |
### Vanilla Component
> Not ready yet
### React Layout
| Path | To |
| --- | --- |
| `/layout.(ts\|js)x` | Layout |
| `/layout.styles.(ts\|js)x` | Layout barrel styles |
| `/proptypes.ts` | Layout props |
| `/styles.(ts\|js)` | Layout styles |
| `/styles.responsive.(ts\|js)` | Layout responsive |
### Svelte Layout
| Path | To |
| --- | --- |
| `/layout.svelte` | Layout |
| `/layout.styles.(ts\|js)x` | Layout barrel styles |
| `/script.(ts\|js).svelte` | Layout script |
| `/proptypes.ts` | Layout props |
| `/styles.(ts\|js)` | Layout styles |
| `/styles.responsive.(ts\|js)` | Layout responsive |
### Vanilla Layout
> Not ready yet
### React Page
| Path | To |
| --- | --- |
| `/page.(ts\|js)x` | Page |
| `/proptypes.ts` | Page props |
| `/locale.json` | Locale for i18n |
| `/i18n.(ts\|js)` | i18n context |
| `/styles.(ts\|js)` | Page styles |
| `/styles.responsive.(ts\|js)` | Page responsive |
| `/router.(ts\|js)` | Router |
| `/route.(ts\|js)` | Route |
| `/config.(ts\|js)` | Config file project |
| `/config.aliases.(ts\|js)` | Project aliases |
| `/tsconfig.json` | TSConfig file project |
| `/tsconfig.aliases.json` | TSConfig aliases |
### Svelte Page
| Path | To |
| --- | --- |
| `/page.svelte` | Page |
| `/script.(ts\|js).svelte` | Page script |
| `/locale.json` | Locale for i18n |
| `/i18n.(ts\|js)` | i18n store |
| `/proptypes.ts` | Page props |
| `/styles.(ts\|js)` | Page styles |
| `/styles.responsive.(ts\|js)` | Page responsive |
| `/config.(ts\|js)` | Svelte config |
| `/config.aliases.(ts\|js)` | Svelte config aliases |
### Vanilla Page
> Not ready yet
### React Schema
| Path | To |
| --- | --- |
| `/schema.(ts\|js)x` | Schema |
| `/proptypes.ts` | Schema props |
### Svelte Schema
| Path | To |
| --- | --- |
| `/schema.(ts\|js)x` | Schema |
| `/proptypes.ts` | Schema props |
| `/proptypes.imports.ts` | Schema props imports |
### Vanilla Schema
> Not ready yet

## Templates keywords

| Keyword | Description |
| --- | --- |
| `NAME_CAMEL` | Camel case name |
| `NAME_PASCAL` | Pascal case name |
| `NAME_DASH` | Dash case name |
| `NAME_CONSTANT` | Constant case name |
| `NAME_SNAKE` | Snake case name |
| `NAME_LOWER` | Lowercase name |
| `NAME` | User input name |
| `NAMESPACE` | User input namespace |
| `EXT_STYLES` | Styles extension |

## Templates keywords for svelte

| Keyword | Description |
| --- | --- |
| `SCRIPT` | Script tag |

## Templates keywords for schemas

| Keyword | Description |
| --- | --- |
| `/* NEXT_TYPE */` | Next type |
| `/* PROPTYPES */` | PropTypes |

## Tempaltes keywords for pages

| Keyword | Description |
| --- | --- |
| `/* NEXT_ALIAS */` | Alias for next page |
| `/* NEXT_LOCALE */` | Locale for next page |
| `/* NEXT_ROUTE */` | Route for next page (Only ReactJS) |

## Templates keywords for pages and schemas

| Keyword | Description |
| --- | --- |
| `/* NEXT_IMPORT */` | Next import |

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